@machina.ai/cell-cli-core 1.41.1-rc2 → 1.45.1-rc1
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/AFTER_MERGE_PROMPT.md +1 -1
- package/dist/docs/changelogs/index.md +63 -0
- package/dist/docs/changelogs/latest.md +200 -244
- package/dist/docs/changelogs/preview.md +198 -385
- package/dist/docs/cli/auto-memory.md +61 -40
- package/dist/docs/cli/cli-reference.md +2 -1
- package/dist/docs/cli/creating-skills.md +165 -38
- package/dist/docs/cli/custom-commands.md +1 -0
- package/dist/docs/cli/gemini-md.md +0 -3
- package/dist/docs/cli/model-routing.md +3 -3
- package/dist/docs/cli/plan-mode.md +2 -2
- package/dist/docs/cli/settings.md +20 -19
- package/dist/docs/cli/skills-best-practices.md +78 -0
- package/dist/docs/cli/skills.md +98 -176
- package/dist/docs/cli/tutorials/memory-management.md +3 -3
- package/dist/docs/cli/tutorials/session-management.md +13 -0
- package/dist/docs/cli/tutorials/skills-getting-started.md +140 -92
- package/dist/docs/cli/using-agent-skills.md +90 -0
- package/dist/docs/core/gemma-setup.md +83 -0
- package/dist/docs/core/index.md +3 -2
- package/dist/docs/core/local-model-routing.md +14 -7
- package/dist/docs/extensions/reference.md +16 -0
- package/dist/docs/extensions/releasing.md +58 -24
- package/dist/docs/extensions/writing-extensions.md +7 -0
- package/dist/docs/get-started/installation.mdx +2 -2
- package/dist/docs/model-routing-spec.md +683 -0
- package/dist/docs/reference/commands.md +14 -7
- package/dist/docs/reference/configuration.md +264 -88
- package/dist/docs/reference/keyboard-shortcuts.md +24 -1
- package/dist/docs/reference/policy-engine.md +14 -3
- package/dist/docs/reference/tools.md +48 -1
- package/dist/docs/releases.md +2 -2
- package/dist/docs/sidebar.json +24 -2
- package/dist/docs/tools/activate-skill.md +1 -1
- package/dist/docs/tools/mcp-server.md +24 -3
- package/dist/docs/tools/memory.md +10 -13
- package/dist/docs/tools/shell.md +17 -0
- package/dist/package.json +18 -18
- package/dist/src/agent/content-utils.js +6 -1
- package/dist/src/agent/content-utils.js.map +1 -1
- package/dist/src/agent/content-utils.test.js +5 -1
- package/dist/src/agent/content-utils.test.js.map +1 -1
- package/dist/src/agent/event-translator.js +8 -7
- package/dist/src/agent/event-translator.js.map +1 -1
- package/dist/src/agent/event-translator.test.js +2 -2
- package/dist/src/agent/event-translator.test.js.map +1 -1
- package/dist/src/agent/legacy-agent-session.js +5 -1
- package/dist/src/agent/legacy-agent-session.js.map +1 -1
- package/dist/src/agent/legacy-agent-session.test.js +11 -3
- package/dist/src/agent/legacy-agent-session.test.js.map +1 -1
- package/dist/src/agent/tool-display-utils.d.ts +3 -2
- package/dist/src/agent/tool-display-utils.js +3 -2
- package/dist/src/agent/tool-display-utils.js.map +1 -1
- package/dist/src/agent/types.d.ts +33 -3
- package/dist/src/agents/a2aUtils.d.ts +1 -1
- package/dist/src/agents/a2aUtils.js +5 -4
- package/dist/src/agents/a2aUtils.js.map +1 -1
- package/dist/src/agents/a2aUtils.test.js +18 -0
- package/dist/src/agents/a2aUtils.test.js.map +1 -1
- package/dist/src/agents/agent-tool.d.ts +3 -1
- package/dist/src/agents/agent-tool.js +19 -3
- package/dist/src/agents/agent-tool.js.map +1 -1
- package/dist/src/agents/agent-tool.test.js +76 -0
- package/dist/src/agents/agent-tool.test.js.map +1 -1
- package/dist/src/agents/agentLoader.d.ts +127 -22
- package/dist/src/agents/agentLoader.js +20 -0
- package/dist/src/agents/agentLoader.js.map +1 -1
- package/dist/src/agents/agentLoader.test.js +60 -0
- package/dist/src/agents/agentLoader.test.js.map +1 -1
- package/dist/src/agents/auth-provider/types.d.ts +5 -0
- package/dist/src/agents/browser/browserAgentInvocation.js +24 -19
- package/dist/src/agents/browser/browserAgentInvocation.js.map +1 -1
- package/dist/src/agents/browser/snapshotSuperseder.js +11 -8
- package/dist/src/agents/browser/snapshotSuperseder.js.map +1 -1
- package/dist/src/agents/browser/snapshotSuperseder.test.js +6 -1
- package/dist/src/agents/browser/snapshotSuperseder.test.js.map +1 -1
- package/dist/src/agents/generalist-agent.js +8 -1
- package/dist/src/agents/generalist-agent.js.map +1 -1
- package/dist/src/agents/generalist-agent.test.js +24 -0
- package/dist/src/agents/generalist-agent.test.js.map +1 -1
- package/dist/src/agents/local-executor.d.ts +1 -0
- package/dist/src/agents/local-executor.js +76 -45
- package/dist/src/agents/local-executor.js.map +1 -1
- package/dist/src/agents/local-executor.test.js +199 -27
- package/dist/src/agents/local-executor.test.js.map +1 -1
- package/dist/src/agents/local-invocation.d.ts +1 -1
- package/dist/src/agents/local-invocation.js +47 -48
- package/dist/src/agents/local-invocation.js.map +1 -1
- package/dist/src/agents/local-invocation.test.js +13 -15
- package/dist/src/agents/local-invocation.test.js.map +1 -1
- package/dist/src/agents/local-session-invocation.d.ts +51 -0
- package/dist/src/agents/local-session-invocation.js +320 -0
- package/dist/src/agents/local-session-invocation.js.map +1 -0
- package/dist/src/agents/local-session-invocation.test.js +512 -0
- package/dist/src/agents/local-session-invocation.test.js.map +1 -0
- package/dist/src/agents/local-subagent-protocol.d.ts +18 -0
- package/dist/src/agents/local-subagent-protocol.js +357 -0
- package/dist/src/agents/local-subagent-protocol.js.map +1 -0
- package/dist/src/agents/local-subagent-protocol.test.js +676 -0
- package/dist/src/agents/local-subagent-protocol.test.js.map +1 -0
- package/dist/src/agents/registry.d.ts +8 -4
- package/dist/src/agents/registry.js +112 -47
- package/dist/src/agents/registry.js.map +1 -1
- package/dist/src/agents/registry.test.js +9 -20
- package/dist/src/agents/registry.test.js.map +1 -1
- package/dist/src/agents/remote-invocation.js +6 -6
- package/dist/src/agents/remote-invocation.js.map +1 -1
- package/dist/src/agents/remote-invocation.test.js +23 -12
- package/dist/src/agents/remote-invocation.test.js.map +1 -1
- package/dist/src/agents/remote-session-invocation.d.ts +48 -0
- package/dist/src/agents/remote-session-invocation.js +193 -0
- package/dist/src/agents/remote-session-invocation.js.map +1 -0
- package/dist/src/agents/remote-session-invocation.test.d.ts +6 -0
- package/dist/src/agents/remote-session-invocation.test.js +405 -0
- package/dist/src/agents/remote-session-invocation.test.js.map +1 -0
- package/dist/src/agents/remote-subagent-protocol.d.ts +42 -0
- package/dist/src/agents/remote-subagent-protocol.js +348 -0
- package/dist/src/agents/remote-subagent-protocol.js.map +1 -0
- package/dist/src/agents/remote-subagent-protocol.test.d.ts +6 -0
- package/dist/src/agents/remote-subagent-protocol.test.js +652 -0
- package/dist/src/agents/remote-subagent-protocol.test.js.map +1 -0
- package/dist/src/agents/skill-extraction-agent.d.ts +8 -1
- package/dist/src/agents/skill-extraction-agent.js +171 -21
- package/dist/src/agents/skill-extraction-agent.js.map +1 -1
- package/dist/src/agents/skill-extraction-agent.test.js +66 -2
- package/dist/src/agents/skill-extraction-agent.test.js.map +1 -1
- package/dist/src/agents/types.d.ts +38 -2
- package/dist/src/agents/types.js +7 -0
- package/dist/src/agents/types.js.map +1 -1
- package/dist/src/availability/autoRoutingFallback.integration.test.d.ts +6 -0
- package/dist/src/availability/autoRoutingFallback.integration.test.js +288 -0
- package/dist/src/availability/autoRoutingFallback.integration.test.js.map +1 -0
- package/dist/src/availability/fallbackIntegration.test.js +29 -0
- package/dist/src/availability/fallbackIntegration.test.js.map +1 -1
- package/dist/src/availability/modelAvailabilityService.d.ts +6 -6
- package/dist/src/availability/modelAvailabilityService.js +16 -8
- package/dist/src/availability/modelAvailabilityService.js.map +1 -1
- package/dist/src/availability/modelAvailabilityService.test.js +39 -0
- package/dist/src/availability/modelAvailabilityService.test.js.map +1 -1
- package/dist/src/availability/modelPolicy.d.ts +1 -0
- package/dist/src/availability/policyCatalog.d.ts +2 -0
- package/dist/src/availability/policyCatalog.js +38 -9
- package/dist/src/availability/policyCatalog.js.map +1 -1
- package/dist/src/availability/policyCatalog.test.js +5 -4
- package/dist/src/availability/policyCatalog.test.js.map +1 -1
- package/dist/src/availability/policyHelpers.js +42 -27
- package/dist/src/availability/policyHelpers.js.map +1 -1
- package/dist/src/availability/policyHelpers.test.js +47 -7
- package/dist/src/availability/policyHelpers.test.js.map +1 -1
- package/dist/src/availability/testUtils.js +1 -1
- package/dist/src/availability/testUtils.js.map +1 -1
- package/dist/src/code_assist/admin/admin_controls.js +3 -1
- package/dist/src/code_assist/admin/admin_controls.js.map +1 -1
- package/dist/src/code_assist/experiments/flagNames.d.ts +1 -1
- package/dist/src/code_assist/experiments/flagNames.js +1 -1
- package/dist/src/code_assist/experiments/flagNames.js.map +1 -1
- package/dist/src/code_assist/oauth-credential-storage.js +12 -3
- package/dist/src/code_assist/oauth-credential-storage.js.map +1 -1
- package/dist/src/code_assist/oauth-credential-storage.test.js +29 -2
- package/dist/src/code_assist/oauth-credential-storage.test.js.map +1 -1
- package/dist/src/code_assist/oauth2.js +12 -3
- package/dist/src/code_assist/oauth2.js.map +1 -1
- package/dist/src/code_assist/oauth2.test.js +38 -0
- package/dist/src/code_assist/oauth2.test.js.map +1 -1
- package/dist/src/code_assist/setup.d.ts +3 -0
- package/dist/src/code_assist/setup.js +9 -0
- package/dist/src/code_assist/setup.js.map +1 -1
- package/dist/src/code_assist/setup.test.js +10 -1
- package/dist/src/code_assist/setup.test.js.map +1 -1
- package/dist/src/commands/memory.d.ts +83 -2
- package/dist/src/commands/memory.js +479 -28
- package/dist/src/commands/memory.js.map +1 -1
- package/dist/src/commands/memory.test.js +414 -58
- package/dist/src/commands/memory.test.js.map +1 -1
- package/dist/src/config/config.d.ts +61 -37
- package/dist/src/config/config.js +294 -101
- package/dist/src/config/config.js.map +1 -1
- package/dist/src/config/config.test.js +365 -113
- package/dist/src/config/config.test.js.map +1 -1
- package/dist/src/config/defaultModelConfigs.js +185 -61
- package/dist/src/config/defaultModelConfigs.js.map +1 -1
- package/dist/src/config/flashFallback.test.js +31 -0
- package/dist/src/config/flashFallback.test.js.map +1 -1
- package/dist/src/config/models.d.ts +20 -10
- package/dist/src/config/models.js +105 -34
- package/dist/src/config/models.js.map +1 -1
- package/dist/src/config/models.test.js +204 -47
- package/dist/src/config/models.test.js.map +1 -1
- package/dist/src/config/projectRegistry.d.ts +1 -0
- package/dist/src/config/projectRegistry.js +14 -3
- package/dist/src/config/projectRegistry.js.map +1 -1
- package/dist/src/config/projectRegistry.test.js +43 -0
- package/dist/src/config/projectRegistry.test.js.map +1 -1
- package/dist/src/config/scoped-config.d.ts +22 -0
- package/dist/src/config/scoped-config.js +32 -0
- package/dist/src/config/scoped-config.js.map +1 -1
- package/dist/src/config/storage.d.ts +0 -1
- package/dist/src/config/storage.js +0 -3
- package/dist/src/config/storage.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.d.ts +3 -1
- package/dist/src/confirmation-bus/message-bus.js +14 -5
- package/dist/src/confirmation-bus/message-bus.js.map +1 -1
- package/dist/src/confirmation-bus/message-bus.test.js +34 -0
- package/dist/src/confirmation-bus/message-bus.test.js.map +1 -1
- package/dist/src/context/chatCompressionService.js +7 -5
- package/dist/src/context/chatCompressionService.js.map +1 -1
- package/dist/src/context/chatCompressionService.test.js +1 -1
- package/dist/src/context/chatCompressionService.test.js.map +1 -1
- package/dist/src/context/config/configLoader.js +4 -1
- package/dist/src/context/config/configLoader.js.map +1 -1
- package/dist/src/context/config/profiles.d.ts +10 -0
- package/dist/src/context/config/profiles.js +98 -3
- package/dist/src/context/config/profiles.js.map +1 -1
- package/dist/src/context/config/schema.d.ts +4 -0
- package/dist/src/context/config/schema.js +4 -0
- package/dist/src/context/config/schema.js.map +1 -1
- package/dist/src/context/config/types.d.ts +13 -1
- package/dist/src/context/contextCompressionService.test.js +7 -3
- package/dist/src/context/contextCompressionService.test.js.map +1 -1
- package/dist/src/context/contextManager.barrier.test.js +39 -16
- package/dist/src/context/contextManager.barrier.test.js.map +1 -1
- package/dist/src/context/contextManager.d.ts +25 -28
- package/dist/src/context/contextManager.hotstart.test.d.ts +6 -0
- package/dist/src/context/contextManager.hotstart.test.js +65 -0
- package/dist/src/context/contextManager.hotstart.test.js.map +1 -0
- package/dist/src/context/contextManager.incremental.test.d.ts +6 -0
- package/dist/src/context/contextManager.incremental.test.js +101 -0
- package/dist/src/context/contextManager.incremental.test.js.map +1 -0
- package/dist/src/context/contextManager.js +276 -79
- package/dist/src/context/contextManager.js.map +1 -1
- package/dist/src/context/contextManager.test.d.ts +6 -0
- package/dist/src/context/contextManager.test.js +142 -0
- package/dist/src/context/contextManager.test.js.map +1 -0
- package/dist/src/context/eventBus.d.ts +13 -0
- package/dist/src/context/eventBus.js +12 -0
- package/dist/src/context/eventBus.js.map +1 -1
- package/dist/src/context/graph/behaviorRegistry.d.ts +4 -12
- package/dist/src/context/graph/behaviorRegistry.js.map +1 -1
- package/dist/src/context/graph/builtinBehaviors.d.ts +6 -1
- package/dist/src/context/graph/builtinBehaviors.js +23 -108
- package/dist/src/context/graph/builtinBehaviors.js.map +1 -1
- package/dist/src/context/graph/fromGraph.d.ts +8 -3
- package/dist/src/context/graph/fromGraph.js +46 -30
- package/dist/src/context/graph/fromGraph.js.map +1 -1
- package/dist/src/context/graph/fromGraph.test.d.ts +6 -0
- package/dist/src/context/graph/fromGraph.test.js +186 -0
- package/dist/src/context/graph/fromGraph.test.js.map +1 -0
- package/dist/src/context/graph/mapper.d.ts +8 -10
- package/dist/src/context/graph/mapper.js +11 -19
- package/dist/src/context/graph/mapper.js.map +1 -1
- package/dist/src/context/graph/mapper.test.d.ts +6 -0
- package/dist/src/context/graph/mapper.test.js +101 -0
- package/dist/src/context/graph/mapper.test.js.map +1 -0
- package/dist/src/context/graph/nodeIdService.d.ts +17 -0
- package/dist/src/context/graph/nodeIdService.js +24 -0
- package/dist/src/context/graph/nodeIdService.js.map +1 -0
- package/dist/src/context/graph/render.d.ts +24 -5
- package/dist/src/context/graph/render.js +129 -34
- package/dist/src/context/graph/render.js.map +1 -1
- package/dist/src/context/graph/render.test.d.ts +6 -0
- package/dist/src/context/graph/render.test.js +280 -0
- package/dist/src/context/graph/render.test.js.map +1 -0
- package/dist/src/context/graph/toGraph.d.ts +16 -14
- package/dist/src/context/graph/toGraph.js +180 -202
- package/dist/src/context/graph/toGraph.js.map +1 -1
- package/dist/src/context/graph/toGraph.test.d.ts +6 -0
- package/dist/src/context/graph/toGraph.test.js +116 -0
- package/dist/src/context/graph/toGraph.test.js.map +1 -0
- package/dist/src/context/graph/types.d.ts +36 -73
- package/dist/src/context/graph/types.js +23 -14
- package/dist/src/context/graph/types.js.map +1 -1
- package/dist/src/context/initializer.js +26 -5
- package/dist/src/context/initializer.js.map +1 -1
- package/dist/src/context/pipeline/contextWorkingBuffer.d.ts +5 -8
- package/dist/src/context/pipeline/contextWorkingBuffer.js +105 -35
- package/dist/src/context/pipeline/contextWorkingBuffer.js.map +1 -1
- package/dist/src/context/pipeline/contextWorkingBuffer.test.js +81 -13
- package/dist/src/context/pipeline/contextWorkingBuffer.test.js.map +1 -1
- package/dist/src/context/pipeline/environment.d.ts +4 -0
- package/dist/src/context/pipeline/environmentImpl.d.ts +6 -5
- package/dist/src/context/pipeline/environmentImpl.js +7 -9
- package/dist/src/context/pipeline/environmentImpl.js.map +1 -1
- package/dist/src/context/pipeline/environmentImpl.test.js +5 -1
- package/dist/src/context/pipeline/environmentImpl.test.js.map +1 -1
- package/dist/src/context/pipeline/orchestrator.d.ts +20 -6
- package/dist/src/context/pipeline/orchestrator.js +97 -80
- package/dist/src/context/pipeline/orchestrator.js.map +1 -1
- package/dist/src/context/pipeline/orchestrator.test.js +33 -36
- package/dist/src/context/pipeline/orchestrator.test.js.map +1 -1
- package/dist/src/context/pipeline.d.ts +0 -1
- package/dist/src/context/processors/blobDegradationProcessor.js +43 -84
- package/dist/src/context/processors/blobDegradationProcessor.js.map +1 -1
- package/dist/src/context/processors/blobDegradationProcessor.test.js +33 -37
- package/dist/src/context/processors/blobDegradationProcessor.test.js.map +1 -1
- package/dist/src/context/processors/nodeDistillationProcessor.js +58 -80
- package/dist/src/context/processors/nodeDistillationProcessor.js.map +1 -1
- package/dist/src/context/processors/nodeDistillationProcessor.test.js +21 -15
- package/dist/src/context/processors/nodeDistillationProcessor.test.js.map +1 -1
- package/dist/src/context/processors/nodeTruncationProcessor.js +16 -60
- package/dist/src/context/processors/nodeTruncationProcessor.js.map +1 -1
- package/dist/src/context/processors/nodeTruncationProcessor.test.js +16 -19
- package/dist/src/context/processors/nodeTruncationProcessor.test.js.map +1 -1
- package/dist/src/context/processors/rollingSummaryProcessor.js +12 -25
- package/dist/src/context/processors/rollingSummaryProcessor.js.map +1 -1
- package/dist/src/context/processors/rollingSummaryProcessor.test.js +10 -9
- package/dist/src/context/processors/rollingSummaryProcessor.test.js.map +1 -1
- package/dist/src/context/processors/stateSnapshotAsyncProcessor.d.ts +7 -0
- package/dist/src/context/processors/stateSnapshotAsyncProcessor.js +37 -19
- package/dist/src/context/processors/stateSnapshotAsyncProcessor.js.map +1 -1
- package/dist/src/context/processors/stateSnapshotAsyncProcessor.test.js +35 -10
- package/dist/src/context/processors/stateSnapshotAsyncProcessor.test.js.map +1 -1
- package/dist/src/context/processors/stateSnapshotProcessor.d.ts +2 -0
- package/dist/src/context/processors/stateSnapshotProcessor.js +53 -21
- package/dist/src/context/processors/stateSnapshotProcessor.js.map +1 -1
- package/dist/src/context/processors/stateSnapshotProcessor.test.js +52 -12
- package/dist/src/context/processors/stateSnapshotProcessor.test.js.map +1 -1
- package/dist/src/context/processors/toolMaskingProcessor.js +96 -117
- package/dist/src/context/processors/toolMaskingProcessor.js.map +1 -1
- package/dist/src/context/processors/toolMaskingProcessor.test.js +50 -17
- package/dist/src/context/processors/toolMaskingProcessor.test.js.map +1 -1
- package/dist/src/context/system-tests/hysteresis.test.d.ts +6 -0
- package/dist/src/context/system-tests/hysteresis.test.js +100 -0
- package/dist/src/context/system-tests/hysteresis.test.js.map +1 -0
- package/dist/src/context/system-tests/lifecycle.golden.test.js +107 -72
- package/dist/src/context/system-tests/lifecycle.golden.test.js.map +1 -1
- package/dist/src/context/system-tests/powerUserLifecycle.test.d.ts +6 -0
- package/dist/src/context/system-tests/powerUserLifecycle.test.js +91 -0
- package/dist/src/context/system-tests/powerUserLifecycle.test.js.map +1 -0
- package/dist/src/context/system-tests/simulationHarness.d.ts +2 -5
- package/dist/src/context/system-tests/simulationHarness.js +34 -35
- package/dist/src/context/system-tests/simulationHarness.js.map +1 -1
- package/dist/src/context/testing/contextTestUtils.d.ts +5 -3
- package/dist/src/context/testing/contextTestUtils.js +74 -53
- package/dist/src/context/testing/contextTestUtils.js.map +1 -1
- package/dist/src/context/testing/testProfile.js +1 -0
- package/dist/src/context/testing/testProfile.js.map +1 -1
- package/dist/src/context/toolOutputMaskingService.js +1 -2
- package/dist/src/context/toolOutputMaskingService.js.map +1 -1
- package/dist/src/context/toolOutputMaskingService.test.js +5 -20
- package/dist/src/context/toolOutputMaskingService.test.js.map +1 -1
- package/dist/src/context/utils/adaptiveTokenCalculator.d.ts +70 -0
- package/dist/src/context/utils/adaptiveTokenCalculator.js +138 -0
- package/dist/src/context/utils/adaptiveTokenCalculator.js.map +1 -0
- package/dist/src/context/utils/adaptiveTokenCalculator.test.d.ts +6 -0
- package/dist/src/context/utils/adaptiveTokenCalculator.test.js +129 -0
- package/dist/src/context/utils/adaptiveTokenCalculator.test.js.map +1 -0
- package/dist/src/context/utils/contextTokenCalculator.d.ts +63 -2
- package/dist/src/context/utils/contextTokenCalculator.js +80 -5
- package/dist/src/context/utils/contextTokenCalculator.js.map +1 -1
- package/dist/src/context/utils/contextTokenCalculator.test.d.ts +6 -0
- package/dist/src/context/utils/contextTokenCalculator.test.js +54 -0
- package/dist/src/context/utils/contextTokenCalculator.test.js.map +1 -0
- package/dist/src/context/utils/formatNodesForLlm.d.ts +21 -0
- package/dist/src/context/utils/formatNodesForLlm.js +69 -0
- package/dist/src/context/utils/formatNodesForLlm.js.map +1 -0
- package/dist/src/context/utils/formatNodesForLlm.test.d.ts +6 -0
- package/dist/src/context/utils/formatNodesForLlm.test.js +110 -0
- package/dist/src/context/utils/formatNodesForLlm.test.js.map +1 -0
- package/dist/src/context/utils/invariantChecker.d.ts +11 -0
- package/dist/src/context/utils/invariantChecker.js +36 -0
- package/dist/src/context/utils/invariantChecker.js.map +1 -0
- package/dist/src/context/utils/snapshotGenerator.d.ts +43 -1
- package/dist/src/context/utils/snapshotGenerator.js +332 -33
- package/dist/src/context/utils/snapshotGenerator.js.map +1 -1
- package/dist/src/context/utils/snapshotGenerator.test.d.ts +6 -0
- package/dist/src/context/utils/snapshotGenerator.test.js +362 -0
- package/dist/src/context/utils/snapshotGenerator.test.js.map +1 -0
- package/dist/src/context/utils/tokenCalibration.d.ts +9 -0
- package/dist/src/context/utils/tokenCalibration.js +30 -0
- package/dist/src/context/utils/tokenCalibration.js.map +1 -0
- package/dist/src/core/agentChatHistory.d.ts +29 -14
- package/dist/src/core/agentChatHistory.js +27 -27
- package/dist/src/core/agentChatHistory.js.map +1 -1
- package/dist/src/core/baseLlmClient.d.ts +8 -0
- package/dist/src/core/baseLlmClient.js +23 -3
- package/dist/src/core/baseLlmClient.js.map +1 -1
- package/dist/src/core/baseLlmClient.test.js +27 -23
- package/dist/src/core/baseLlmClient.test.js.map +1 -1
- package/dist/src/core/client.d.ts +7 -5
- package/dist/src/core/client.js +65 -40
- package/dist/src/core/client.js.map +1 -1
- package/dist/src/core/client.test.js +35 -131
- package/dist/src/core/client.test.js.map +1 -1
- package/dist/src/core/contentGenerator.js +46 -21
- package/dist/src/core/contentGenerator.js.map +1 -1
- package/dist/src/core/contentGenerator.test.js +191 -13
- package/dist/src/core/contentGenerator.test.js.map +1 -1
- package/dist/src/core/fakeContentGenerator.d.ts +15 -3
- package/dist/src/core/fakeContentGenerator.js +29 -9
- package/dist/src/core/fakeContentGenerator.js.map +1 -1
- package/dist/src/core/geminiChat.d.ts +18 -7
- package/dist/src/core/geminiChat.js +312 -54
- package/dist/src/core/geminiChat.js.map +1 -1
- package/dist/src/core/geminiChat.test.js +448 -54
- package/dist/src/core/geminiChat.test.js.map +1 -1
- package/dist/src/core/geminiChat_network_retry.test.js +39 -0
- package/dist/src/core/geminiChat_network_retry.test.js.map +1 -1
- package/dist/src/core/localLiteRtLmClient.js +6 -2
- package/dist/src/core/localLiteRtLmClient.js.map +1 -1
- package/dist/src/core/prompts.test.js +12 -7
- package/dist/src/core/prompts.test.js.map +1 -1
- package/dist/src/core/turn.d.ts +7 -2
- package/dist/src/core/turn.js +61 -4
- package/dist/src/core/turn.js.map +1 -1
- package/dist/src/core/turn.test.js +19 -10
- package/dist/src/core/turn.test.js.map +1 -1
- package/dist/src/fallback/handler.js +16 -6
- package/dist/src/fallback/handler.js.map +1 -1
- package/dist/src/fallback/handler.test.js +8 -2
- package/dist/src/fallback/handler.test.js.map +1 -1
- package/dist/src/generated/git-commit.d.ts +2 -2
- package/dist/src/generated/git-commit.js +2 -2
- package/dist/src/hooks/hookEventHandler.js +3 -2
- package/dist/src/hooks/hookEventHandler.js.map +1 -1
- package/dist/src/hooks/hookEventHandler.test.js +80 -0
- package/dist/src/hooks/hookEventHandler.test.js.map +1 -1
- package/dist/src/hooks/hookRunner.test.js +3 -3
- package/dist/src/hooks/hookRunner.test.js.map +1 -1
- package/dist/src/hooks/hookTranslator.js +95 -5
- package/dist/src/hooks/hookTranslator.js.map +1 -1
- package/dist/src/hooks/hookTranslator.test.js +171 -0
- package/dist/src/hooks/hookTranslator.test.js.map +1 -1
- package/dist/src/ide/ide-client.js +5 -3
- package/dist/src/ide/ide-client.js.map +1 -1
- package/dist/src/ide/ide-connection-utils.js +12 -10
- package/dist/src/ide/ide-connection-utils.js.map +1 -1
- package/dist/src/ide/ide-connection-utils.test.js +25 -2
- package/dist/src/ide/ide-connection-utils.test.js.map +1 -1
- package/dist/src/ide/types.d.ts +16 -16
- package/dist/src/index.d.ts +5 -2
- package/dist/src/index.js +5 -3
- package/dist/src/index.js.map +1 -1
- package/dist/src/mcp/oauth-provider.d.ts +8 -0
- package/dist/src/mcp/oauth-provider.js +41 -0
- package/dist/src/mcp/oauth-provider.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.js +7 -1
- package/dist/src/mcp/oauth-token-storage.js.map +1 -1
- package/dist/src/mcp/oauth-token-storage.test.js +55 -0
- package/dist/src/mcp/oauth-token-storage.test.js.map +1 -1
- package/dist/src/mcp/stored-token-provider.d.ts +27 -0
- package/dist/src/mcp/stored-token-provider.js +76 -0
- package/dist/src/mcp/stored-token-provider.js.map +1 -0
- package/dist/src/mcp/token-storage/keychain-token-storage.js +2 -2
- package/dist/src/mcp/token-storage/keychain-token-storage.js.map +1 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js +14 -1
- package/dist/src/mcp/token-storage/keychain-token-storage.test.js.map +1 -1
- package/dist/src/output/json-formatter.d.ts +1 -1
- package/dist/src/output/json-formatter.js +4 -1
- package/dist/src/output/json-formatter.js.map +1 -1
- package/dist/src/output/json-formatter.test.js +7 -0
- package/dist/src/output/json-formatter.test.js.map +1 -1
- package/dist/src/output/types.d.ts +1 -0
- package/dist/src/output/types.js.map +1 -1
- package/dist/src/policy/config.js +25 -0
- package/dist/src/policy/config.js.map +1 -1
- package/dist/src/policy/config.test.js +80 -0
- package/dist/src/policy/config.test.js.map +1 -1
- package/dist/src/policy/core-tools-mapping.test.js +9 -1
- package/dist/src/policy/core-tools-mapping.test.js.map +1 -1
- package/dist/src/policy/policies/plan.toml +1 -1
- package/dist/src/policy/policies/write.toml +0 -7
- package/dist/src/policy/policy-engine.test.js +0 -8
- package/dist/src/policy/policy-engine.test.js.map +1 -1
- package/dist/src/policy/sandboxPolicyManager.d.ts +20 -20
- package/dist/src/policy/stable-stringify.js +10 -6
- package/dist/src/policy/stable-stringify.js.map +1 -1
- package/dist/src/policy/stable-stringify.test.js +157 -0
- package/dist/src/policy/stable-stringify.test.js.map +1 -0
- package/dist/src/policy/types.d.ts +1 -0
- package/dist/src/policy/types.js.map +1 -1
- package/dist/src/prompts/promptProvider.js +8 -9
- package/dist/src/prompts/promptProvider.js.map +1 -1
- package/dist/src/prompts/promptProvider.test.js +3 -1
- package/dist/src/prompts/promptProvider.test.js.map +1 -1
- package/dist/src/prompts/snippets-memory.test.d.ts +6 -0
- package/dist/src/prompts/{snippets-memory-v2.test.js → snippets-memory.test.js} +5 -23
- package/dist/src/prompts/snippets-memory.test.js.map +1 -0
- package/dist/src/prompts/snippets.d.ts +6 -11
- package/dist/src/prompts/snippets.js +28 -30
- package/dist/src/prompts/snippets.js.map +1 -1
- package/dist/src/prompts/snippets.legacy.d.ts +0 -1
- package/dist/src/prompts/snippets.legacy.js +8 -15
- package/dist/src/prompts/snippets.legacy.js.map +1 -1
- package/dist/src/routing/strategies/approvalModeStrategy.js +5 -3
- package/dist/src/routing/strategies/approvalModeStrategy.js.map +1 -1
- package/dist/src/routing/strategies/approvalModeStrategy.test.js +9 -0
- package/dist/src/routing/strategies/approvalModeStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.js +18 -4
- package/dist/src/routing/strategies/classifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js +77 -1
- package/dist/src/routing/strategies/classifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/defaultStrategy.js +1 -1
- package/dist/src/routing/strategies/defaultStrategy.js.map +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js +1 -1
- package/dist/src/routing/strategies/fallbackStrategy.js.map +1 -1
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js +7 -1
- package/dist/src/routing/strategies/gemmaClassifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js +15 -1
- package/dist/src/routing/strategies/gemmaClassifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/numericalClassifierStrategy.d.ts +1 -0
- package/dist/src/routing/strategies/numericalClassifierStrategy.js +32 -5
- package/dist/src/routing/strategies/numericalClassifierStrategy.js.map +1 -1
- package/dist/src/routing/strategies/numericalClassifierStrategy.test.js +247 -25
- package/dist/src/routing/strategies/numericalClassifierStrategy.test.js.map +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js +1 -1
- package/dist/src/routing/strategies/overrideStrategy.js.map +1 -1
- package/dist/src/sandbox/utils/commandSafety.js +22 -2
- package/dist/src/sandbox/utils/commandSafety.js.map +1 -1
- package/dist/src/sandbox/utils/commandSafety.test.d.ts +6 -0
- package/dist/src/sandbox/utils/commandSafety.test.js +85 -0
- package/dist/src/sandbox/utils/commandSafety.test.js.map +1 -0
- package/dist/src/scheduler/confirmation.test.js +29 -0
- package/dist/src/scheduler/confirmation.test.js.map +1 -1
- package/dist/src/scheduler/scheduler.js +15 -0
- package/dist/src/scheduler/scheduler.js.map +1 -1
- package/dist/src/scheduler/scheduler.test.js +1 -1
- package/dist/src/scheduler/scheduler.test.js.map +1 -1
- package/dist/src/scheduler/scheduler_parallel.test.js +37 -0
- package/dist/src/scheduler/scheduler_parallel.test.js.map +1 -1
- package/dist/src/scheduler/state-manager.js +5 -1
- package/dist/src/scheduler/state-manager.js.map +1 -1
- package/dist/src/scheduler/tool-executor.js +7 -4
- package/dist/src/scheduler/tool-executor.js.map +1 -1
- package/dist/src/scheduler/types.d.ts +5 -1
- package/dist/src/scheduler/types.js.map +1 -1
- package/dist/src/services/chatRecordingService.d.ts +14 -7
- package/dist/src/services/chatRecordingService.js +157 -133
- package/dist/src/services/chatRecordingService.js.map +1 -1
- package/dist/src/services/chatRecordingService.test.js +189 -52
- package/dist/src/services/chatRecordingService.test.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.js +2 -1
- package/dist/src/services/fileDiscoveryService.js.map +1 -1
- package/dist/src/services/fileDiscoveryService.test.js +36 -0
- package/dist/src/services/fileDiscoveryService.test.js.map +1 -1
- package/dist/src/services/gitService.js +43 -4
- package/dist/src/services/gitService.js.map +1 -1
- package/dist/src/services/gitService.test.js +105 -1
- package/dist/src/services/gitService.test.js.map +1 -1
- package/dist/src/services/keychainService.js +14 -5
- package/dist/src/services/keychainService.js.map +1 -1
- package/dist/src/services/memoryPatchUtils.d.ts +93 -0
- package/dist/src/services/memoryPatchUtils.js +310 -2
- package/dist/src/services/memoryPatchUtils.js.map +1 -1
- package/dist/src/services/memoryService.d.ts +2 -0
- package/dist/src/services/memoryService.js +214 -9
- package/dist/src/services/memoryService.js.map +1 -1
- package/dist/src/services/memoryService.test.js +133 -0
- package/dist/src/services/memoryService.test.js.map +1 -1
- package/dist/src/services/modelConfigService.d.ts +3 -0
- package/dist/src/services/modelConfigService.js +22 -13
- package/dist/src/services/modelConfigService.js.map +1 -1
- package/dist/src/services/modelConfigService.test.js +73 -0
- package/dist/src/services/modelConfigService.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.js +88 -41
- package/dist/src/services/shellExecutionService.js.map +1 -1
- package/dist/src/services/shellExecutionService.test.js +22 -9
- package/dist/src/services/shellExecutionService.test.js.map +1 -1
- package/dist/src/services/shellExecutionService.windows.integration.test.d.ts +6 -0
- package/dist/src/services/shellExecutionService.windows.integration.test.js +63 -0
- package/dist/src/services/shellExecutionService.windows.integration.test.js.map +1 -0
- package/dist/src/services/test-data/resolved-aliases-retry.golden.json +85 -7
- package/dist/src/services/test-data/resolved-aliases.golden.json +85 -7
- package/dist/src/services/trackerTypes.d.ts +4 -4
- package/dist/src/skills/skillManager.d.ts +4 -0
- package/dist/src/skills/skillManager.js +6 -0
- package/dist/src/skills/skillManager.js.map +1 -1
- package/dist/src/skills/skillManager.test.js +10 -0
- package/dist/src/skills/skillManager.test.js.map +1 -1
- package/dist/src/telemetry/file-exporters.d.ts +4 -1
- package/dist/src/telemetry/file-exporters.js +21 -3
- package/dist/src/telemetry/file-exporters.js.map +1 -1
- package/dist/src/telemetry/file-exporters.test.js +32 -2
- package/dist/src/telemetry/file-exporters.test.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.d.ts +3 -0
- package/dist/src/telemetry/gcp-exporters.js +72 -5
- package/dist/src/telemetry/gcp-exporters.js.map +1 -1
- package/dist/src/telemetry/gcp-exporters.test.js +52 -0
- package/dist/src/telemetry/gcp-exporters.test.js.map +1 -1
- package/dist/src/telemetry/heap-snapshot.d.ts +12 -0
- package/dist/src/telemetry/heap-snapshot.js +35 -0
- package/dist/src/telemetry/heap-snapshot.js.map +1 -0
- package/dist/src/telemetry/heap-snapshot.test.d.ts +6 -0
- package/dist/src/telemetry/heap-snapshot.test.js +38 -0
- package/dist/src/telemetry/heap-snapshot.test.js.map +1 -0
- package/dist/src/telemetry/index.d.ts +1 -0
- package/dist/src/telemetry/index.js +1 -0
- package/dist/src/telemetry/index.js.map +1 -1
- package/dist/src/telemetry/loggers.test.js +1 -0
- package/dist/src/telemetry/loggers.test.js.map +1 -1
- package/dist/src/telemetry/memory-monitor.d.ts +5 -0
- package/dist/src/telemetry/memory-monitor.js +8 -0
- package/dist/src/telemetry/memory-monitor.js.map +1 -1
- package/dist/src/telemetry/metrics.js +13 -2
- package/dist/src/telemetry/metrics.js.map +1 -1
- package/dist/src/telemetry/metrics.test.js +61 -1
- package/dist/src/telemetry/metrics.test.js.map +1 -1
- package/dist/src/test-utils/config.js +10 -1
- package/dist/src/test-utils/config.js.map +1 -1
- package/dist/src/tools/ask-user.js +25 -1
- package/dist/src/tools/ask-user.js.map +1 -1
- package/dist/src/tools/ask-user.test.js +46 -1
- package/dist/src/tools/ask-user.test.js.map +1 -1
- package/dist/src/tools/definitions/base-declarations.d.ts +0 -3
- package/dist/src/tools/definitions/base-declarations.js +0 -4
- package/dist/src/tools/definitions/base-declarations.js.map +1 -1
- package/dist/src/tools/definitions/coreTools.d.ts +1 -2
- package/dist/src/tools/definitions/coreTools.js +2 -8
- package/dist/src/tools/definitions/coreTools.js.map +1 -1
- package/dist/src/tools/definitions/coreToolsModelSnapshots.test.js +1 -2
- package/dist/src/tools/definitions/coreToolsModelSnapshots.test.js.map +1 -1
- package/dist/src/tools/definitions/model-family-sets/default-legacy.js +7 -31
- package/dist/src/tools/definitions/model-family-sets/default-legacy.js.map +1 -1
- package/dist/src/tools/definitions/model-family-sets/gemini-3.js +9 -26
- package/dist/src/tools/definitions/model-family-sets/gemini-3.js.map +1 -1
- package/dist/src/tools/definitions/types.d.ts +0 -1
- package/dist/src/tools/edit.js +27 -5
- package/dist/src/tools/edit.js.map +1 -1
- package/dist/src/tools/edit.test.js +37 -0
- package/dist/src/tools/edit.test.js.map +1 -1
- package/dist/src/tools/grep.js +14 -2
- package/dist/src/tools/grep.js.map +1 -1
- package/dist/src/tools/grep.test.js +17 -0
- package/dist/src/tools/grep.test.js.map +1 -1
- package/dist/src/tools/jit-context.d.ts +1 -1
- package/dist/src/tools/jit-context.js +1 -4
- package/dist/src/tools/jit-context.js.map +1 -1
- package/dist/src/tools/jit-context.test.js +1 -13
- package/dist/src/tools/jit-context.test.js.map +1 -1
- package/dist/src/tools/ls.js +5 -0
- package/dist/src/tools/ls.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.js +2 -1
- package/dist/src/tools/mcp-client-manager.js.map +1 -1
- package/dist/src/tools/mcp-client-manager.test.js +29 -0
- package/dist/src/tools/mcp-client-manager.test.js.map +1 -1
- package/dist/src/tools/mcp-client.js +89 -50
- package/dist/src/tools/mcp-client.js.map +1 -1
- package/dist/src/tools/mcp-client.test.js +353 -59
- package/dist/src/tools/mcp-client.test.js.map +1 -1
- package/dist/src/tools/{xcode-mcp-fix-transport.d.ts → mcp-compliance-transport.d.ts} +6 -6
- package/dist/src/tools/{xcode-mcp-fix-transport.js → mcp-compliance-transport.js} +6 -6
- package/dist/src/tools/mcp-compliance-transport.js.map +1 -0
- package/dist/src/tools/mcp-compliance-transport.test.d.ts +6 -0
- package/dist/src/tools/mcp-compliance-transport.test.js +162 -0
- package/dist/src/tools/mcp-compliance-transport.test.js.map +1 -0
- package/dist/src/tools/memoryTool.d.ts +9 -31
- package/dist/src/tools/memoryTool.js +47 -262
- package/dist/src/tools/memoryTool.js.map +1 -1
- package/dist/src/tools/memoryTool.test.js +41 -312
- package/dist/src/tools/memoryTool.test.js.map +1 -1
- package/dist/src/tools/read-file.js +11 -6
- package/dist/src/tools/read-file.js.map +1 -1
- package/dist/src/tools/read-file.test.js +20 -8
- package/dist/src/tools/read-file.test.js.map +1 -1
- package/dist/src/tools/read-many-files.js +2 -2
- package/dist/src/tools/read-many-files.js.map +1 -1
- package/dist/src/tools/ripGrep.d.ts +3 -7
- package/dist/src/tools/ripGrep.js +57 -35
- package/dist/src/tools/ripGrep.js.map +1 -1
- package/dist/src/tools/ripGrep.test.js +197 -276
- package/dist/src/tools/ripGrep.test.js.map +1 -1
- package/dist/src/tools/shell.d.ts +5 -3
- package/dist/src/tools/shell.js +130 -36
- package/dist/src/tools/shell.js.map +1 -1
- package/dist/src/tools/shell.test.js +186 -14
- package/dist/src/tools/shell.test.js.map +1 -1
- package/dist/src/tools/shell_proactive.test.js +1 -0
- package/dist/src/tools/shell_proactive.test.js.map +1 -1
- package/dist/src/tools/tool-names.d.ts +3 -3
- package/dist/src/tools/tool-names.js +4 -5
- package/dist/src/tools/tool-names.js.map +1 -1
- package/dist/src/tools/tool-registry.js +1 -1
- package/dist/src/tools/tool-registry.js.map +1 -1
- package/dist/src/tools/tools.d.ts +6 -0
- package/dist/src/tools/tools.js.map +1 -1
- package/dist/src/tools/topicTool.js +5 -0
- package/dist/src/tools/topicTool.js.map +1 -1
- package/dist/src/tools/write-file.js +13 -0
- package/dist/src/tools/write-file.js.map +1 -1
- package/dist/src/tools/write-file.test.js +8 -0
- package/dist/src/tools/write-file.test.js.map +1 -1
- package/dist/src/utils/atCommandUtils.d.ts +35 -0
- package/dist/src/utils/atCommandUtils.js +163 -0
- package/dist/src/utils/atCommandUtils.js.map +1 -0
- package/dist/src/utils/atCommandUtils.test.d.ts +6 -0
- package/dist/src/utils/atCommandUtils.test.js +292 -0
- package/dist/src/utils/atCommandUtils.test.js.map +1 -0
- package/dist/src/utils/channel.d.ts +8 -0
- package/dist/src/utils/channel.js +21 -10
- package/dist/src/utils/channel.js.map +1 -1
- package/dist/src/utils/cryptoUtils.d.ts +11 -0
- package/dist/src/utils/cryptoUtils.js +19 -0
- package/dist/src/utils/cryptoUtils.js.map +1 -0
- package/dist/src/utils/cryptoUtils.test.d.ts +6 -0
- package/dist/src/utils/cryptoUtils.test.js +31 -0
- package/dist/src/utils/cryptoUtils.test.js.map +1 -0
- package/dist/src/utils/editor.d.ts +29 -3
- package/dist/src/utils/editor.js +94 -3
- package/dist/src/utils/editor.js.map +1 -1
- package/dist/src/utils/editor.test.js +176 -2
- package/dist/src/utils/editor.test.js.map +1 -1
- package/dist/src/utils/environmentContext.d.ts +2 -1
- package/dist/src/utils/environmentContext.js +15 -8
- package/dist/src/utils/environmentContext.js.map +1 -1
- package/dist/src/utils/environmentContext.test.js +4 -14
- package/dist/src/utils/environmentContext.test.js.map +1 -1
- package/dist/src/utils/errors.js +3 -8
- package/dist/src/utils/errors.js.map +1 -1
- package/dist/src/utils/events.d.ts +26 -1
- package/dist/src/utils/events.js +21 -2
- package/dist/src/utils/events.js.map +1 -1
- package/dist/src/utils/events.test.js +39 -0
- package/dist/src/utils/events.test.js.map +1 -1
- package/dist/src/utils/extensionLoader.js +2 -2
- package/dist/src/utils/extensionLoader.js.map +1 -1
- package/dist/src/utils/extensionLoader.test.js +22 -15
- package/dist/src/utils/extensionLoader.test.js.map +1 -1
- package/dist/src/utils/fetch.d.ts +3 -3
- package/dist/src/utils/fetch.js +41 -17
- package/dist/src/utils/fetch.js.map +1 -1
- package/dist/src/utils/fetch.test.js +93 -17
- package/dist/src/utils/fetch.test.js.map +1 -1
- package/dist/src/utils/fileUtils.js +4 -1
- package/dist/src/utils/fileUtils.js.map +1 -1
- package/dist/src/utils/filesearch/fileSearch.js +20 -9
- package/dist/src/utils/filesearch/fileSearch.js.map +1 -1
- package/dist/src/utils/filesearch/ignore.js +4 -1
- package/dist/src/utils/filesearch/ignore.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.d.ts +1 -0
- package/dist/src/utils/generateContentResponseUtilities.js +37 -7
- package/dist/src/utils/generateContentResponseUtilities.js.map +1 -1
- package/dist/src/utils/generateContentResponseUtilities.test.js +33 -0
- package/dist/src/utils/generateContentResponseUtilities.test.js.map +1 -1
- package/dist/src/utils/gitUtils.d.ts +5 -0
- package/dist/src/utils/gitUtils.js +11 -0
- package/dist/src/utils/gitUtils.js.map +1 -1
- package/dist/src/utils/historyHardening.d.ts +37 -0
- package/dist/src/utils/historyHardening.js +332 -0
- package/dist/src/utils/historyHardening.js.map +1 -0
- package/dist/src/utils/historyHardening.test.d.ts +6 -0
- package/dist/src/utils/historyHardening.test.js +317 -0
- package/dist/src/utils/historyHardening.test.js.map +1 -0
- package/dist/src/utils/ignoreFileParser.js +1 -1
- package/dist/src/utils/ignoreFileParser.js.map +1 -1
- package/dist/src/utils/ignorePatterns.js +2 -0
- package/dist/src/utils/ignorePatterns.js.map +1 -1
- package/dist/src/utils/ignorePatterns.test.js +1 -0
- package/dist/src/utils/ignorePatterns.test.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.d.ts +0 -20
- package/dist/src/utils/memoryDiscovery.js +57 -220
- package/dist/src/utils/memoryDiscovery.js.map +1 -1
- package/dist/src/utils/memoryDiscovery.test.js +112 -403
- package/dist/src/utils/memoryDiscovery.test.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +14 -0
- package/dist/src/utils/modelUtils.js +17 -0
- package/dist/src/utils/modelUtils.js.map +1 -0
- package/dist/src/utils/modelUtils.test.d.ts +6 -0
- package/dist/src/utils/modelUtils.test.js +23 -0
- package/dist/src/utils/modelUtils.test.js.map +1 -0
- package/dist/src/utils/partUtils.d.ts +26 -1
- package/dist/src/utils/partUtils.js +37 -0
- package/dist/src/utils/partUtils.js.map +1 -1
- package/dist/src/utils/path-validator.d.ts +17 -0
- package/dist/src/utils/path-validator.js +76 -0
- package/dist/src/utils/path-validator.js.map +1 -0
- package/dist/src/utils/path-validator.test.d.ts +6 -0
- package/dist/src/utils/path-validator.test.js +91 -0
- package/dist/src/utils/path-validator.test.js.map +1 -0
- package/dist/src/utils/pathReader.js +12 -0
- package/dist/src/utils/pathReader.js.map +1 -1
- package/dist/src/utils/pathReader.test.js +95 -0
- package/dist/src/utils/pathReader.test.js.map +1 -1
- package/dist/src/utils/paths.d.ts +19 -1
- package/dist/src/utils/paths.js +74 -9
- package/dist/src/utils/paths.js.map +1 -1
- package/dist/src/utils/paths.test.js +111 -1
- package/dist/src/utils/paths.test.js.map +1 -1
- package/dist/src/utils/quotaErrorDetection.js +23 -12
- package/dist/src/utils/quotaErrorDetection.js.map +1 -1
- package/dist/src/utils/ragLogger.d.ts +32 -0
- package/dist/src/utils/ragLogger.js +56 -0
- package/dist/src/utils/ragLogger.js.map +1 -0
- package/dist/src/utils/ragLogger.test.d.ts +6 -0
- package/dist/src/utils/ragLogger.test.js +97 -0
- package/dist/src/utils/ragLogger.test.js.map +1 -0
- package/dist/src/utils/retry.js +8 -3
- package/dist/src/utils/retry.js.map +1 -1
- package/dist/src/utils/retry.test.js +17 -0
- package/dist/src/utils/retry.test.js.map +1 -1
- package/dist/src/utils/safeJsonStringify.js +0 -2
- package/dist/src/utils/safeJsonStringify.js.map +1 -1
- package/dist/src/utils/sessionOperations.d.ts +26 -0
- package/dist/src/utils/sessionOperations.js +177 -8
- package/dist/src/utils/sessionOperations.js.map +1 -1
- package/dist/src/utils/sessionUtils.d.ts +11 -5
- package/dist/src/utils/sessionUtils.js +139 -68
- package/dist/src/utils/sessionUtils.js.map +1 -1
- package/dist/src/utils/sessionUtils.test.js +31 -5
- package/dist/src/utils/sessionUtils.test.js.map +1 -1
- package/dist/src/utils/shell-utils.d.ts +9 -1
- package/dist/src/utils/shell-utils.js +51 -20
- package/dist/src/utils/shell-utils.js.map +1 -1
- package/dist/src/utils/shell-utils.test.js +87 -46
- package/dist/src/utils/shell-utils.test.js.map +1 -1
- package/dist/src/utils/textUtils.d.ts +12 -2
- package/dist/src/utils/textUtils.js +30 -3
- package/dist/src/utils/textUtils.js.map +1 -1
- package/dist/src/utils/textUtils.test.js +96 -1
- package/dist/src/utils/textUtils.test.js.map +1 -1
- package/dist/src/utils/tokenCalculation.d.ts +3 -2
- package/dist/src/utils/tokenCalculation.js +9 -5
- package/dist/src/utils/tokenCalculation.js.map +1 -1
- package/dist/src/utils/tokenCalculation.test.js +15 -0
- package/dist/src/utils/tokenCalculation.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -18
- package/dist/src/context/historyObserver.d.ts +0 -28
- package/dist/src/context/historyObserver.js +0 -63
- package/dist/src/context/historyObserver.js.map +0 -1
- package/dist/src/policy/memory-manager-policy.test.js +0 -80
- package/dist/src/policy/memory-manager-policy.test.js.map +0 -1
- package/dist/src/policy/policies/memory-manager.toml +0 -20
- package/dist/src/prompts/snippets-memory-v2.test.js.map +0 -1
- package/dist/src/tools/xcode-mcp-fix-transport.js.map +0 -1
- package/dist/src/tools/xcode-mcp-fix-transport.test.d.ts +0 -1
- package/dist/src/tools/xcode-mcp-fix-transport.test.js +0 -98
- package/dist/src/tools/xcode-mcp-fix-transport.test.js.map +0 -1
- package/dist/src/utils/systemEncoding.d.ts +0 -40
- package/dist/src/utils/systemEncoding.js +0 -150
- package/dist/src/utils/systemEncoding.js.map +0 -1
- package/dist/src/utils/systemEncoding.test.js +0 -369
- package/dist/src/utils/systemEncoding.test.js.map +0 -1
- /package/dist/src/{policy/memory-manager-policy.test.d.ts → agents/local-session-invocation.test.d.ts} +0 -0
- /package/dist/src/{prompts/snippets-memory-v2.test.d.ts → agents/local-subagent-protocol.test.d.ts} +0 -0
- /package/dist/src/{utils/systemEncoding.test.d.ts → policy/stable-stringify.test.d.ts} +0 -0
|
@@ -18,14 +18,14 @@ import { ReadFileTool } from '../tools/read-file.js';
|
|
|
18
18
|
import { ReadMcpResourceTool } from '../tools/read-mcp-resource.js';
|
|
19
19
|
import { ListMcpResourcesTool } from '../tools/list-mcp-resources.js';
|
|
20
20
|
import { GrepTool } from '../tools/grep.js';
|
|
21
|
-
import {
|
|
21
|
+
import { RipGrepTool, resolveRipgrepPath } from '../tools/ripGrep.js';
|
|
22
22
|
import { GlobTool } from '../tools/glob.js';
|
|
23
23
|
import { ActivateSkillTool } from '../tools/activate-skill.js';
|
|
24
24
|
import { EditTool } from '../tools/edit.js';
|
|
25
25
|
import { ShellTool } from '../tools/shell.js';
|
|
26
26
|
import { WriteFileTool } from '../tools/write-file.js';
|
|
27
27
|
import { WebFetchTool } from '../tools/web-fetch.js';
|
|
28
|
-
import {
|
|
28
|
+
import { setGeminiMdFilename, getCurrentGeminiMdFilename, } from '../tools/memoryTool.js';
|
|
29
29
|
import { WebSearchTool } from '../tools/web-search.js';
|
|
30
30
|
import { AskUserTool } from '../tools/ask-user.js';
|
|
31
31
|
import { UpdateTopicTool } from '../tools/topicTool.js';
|
|
@@ -45,7 +45,7 @@ import { SandboxedFileSystemService } from '../services/sandboxedFileSystemServi
|
|
|
45
45
|
import { initializeTelemetry, DEFAULT_TELEMETRY_TARGET, DEFAULT_OTLP_ENDPOINT, uiTelemetryService, } from '../telemetry/index.js';
|
|
46
46
|
import { coreEvents, CoreEvent } from '../utils/events.js';
|
|
47
47
|
import { tokenLimit } from '../core/tokenLimits.js';
|
|
48
|
-
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL,
|
|
48
|
+
import { DEFAULT_GEMINI_EMBEDDING_MODEL, DEFAULT_GEMINI_FLASH_MODEL, DEFAULT_GEMINI_MODEL_AUTO, isAutoModel, isPreviewModel, isGemini2Model, PREVIEW_GEMINI_FLASH_MODEL, resolveModel, setFlashModels, } from './models.js';
|
|
49
49
|
import { shouldAttemptBrowserLaunch } from '../utils/browser.js';
|
|
50
50
|
import { ideContextStore } from '../ide/ideContext.js';
|
|
51
51
|
import { WriteTodosTool } from '../tools/write-todos.js';
|
|
@@ -61,7 +61,7 @@ import { DEFAULT_MODEL_CONFIGS } from './defaultModelConfigs.js';
|
|
|
61
61
|
import { MemoryContextManager } from '../context/memoryContextManager.js';
|
|
62
62
|
import { TrackerService } from '../services/trackerService.js';
|
|
63
63
|
import { WorkspaceContext } from '../utils/workspaceContext.js';
|
|
64
|
-
import { getWorkspaceContextOverride } from './scoped-config.js';
|
|
64
|
+
import { getWorkspaceContextOverride, hasScopedAutoMemoryExtractionWriteAccess, hasScopedMemoryInboxAccess, } from './scoped-config.js';
|
|
65
65
|
import { Storage } from './storage.js';
|
|
66
66
|
import { FileExclusions } from '../utils/ignorePatterns.js';
|
|
67
67
|
import { MessageBus } from '../confirmation-bus/message-bus.js';
|
|
@@ -75,10 +75,12 @@ import { AcknowledgedAgentsService } from '../agents/acknowledgedAgents.js';
|
|
|
75
75
|
import { setGlobalProxy, updateGlobalFetchTimeouts } from '../utils/fetch.js';
|
|
76
76
|
import { ExperimentFlags } from '../code_assist/experiments/flagNames.js';
|
|
77
77
|
import { debugLogger } from '../utils/debugLogger.js';
|
|
78
|
+
import { ragLogger } from '../utils/ragLogger.js';
|
|
78
79
|
import { SkillManager } from '../skills/skillManager.js';
|
|
79
80
|
import { startupProfiler } from '../telemetry/startupProfiler.js';
|
|
80
81
|
import { fetchAdminControls } from '../code_assist/admin/admin_controls.js';
|
|
81
82
|
import { isSubpath, resolveToRealPath } from '../utils/paths.js';
|
|
83
|
+
import { validatePath } from '../utils/path-validator.js';
|
|
82
84
|
import { InjectionService } from './injectionService.js';
|
|
83
85
|
import { ExecutionLifecycleService } from '../services/executionLifecycleService.js';
|
|
84
86
|
import { WORKSPACE_POLICY_TIER } from '../policy/config.js';
|
|
@@ -87,6 +89,7 @@ import { CheckerRunner } from '../safety/checker-runner.js';
|
|
|
87
89
|
import { ContextBuilder } from '../safety/context-builder.js';
|
|
88
90
|
import { CheckerRegistry } from '../safety/registry.js';
|
|
89
91
|
import { ConsecaSafetyChecker } from '../safety/conseca/conseca.js';
|
|
92
|
+
import { getChannelFromVersion } from '../utils/channel.js';
|
|
90
93
|
import { DEFAULT_MAX_ATTEMPTS } from '../utils/retry.js';
|
|
91
94
|
import { DEFAULT_FILE_FILTERING_OPTIONS, DEFAULT_MEMORY_FILE_FILTERING_OPTIONS, } from './constants.js';
|
|
92
95
|
import { DEFAULT_TOOL_PROTECTION_THRESHOLD, DEFAULT_MIN_PRUNABLE_TOKENS_THRESHOLD, DEFAULT_PROTECT_LATEST_TURN, } from '../context/toolOutputMaskingService.js';
|
|
@@ -217,7 +220,7 @@ export class Config {
|
|
|
217
220
|
skillManager;
|
|
218
221
|
_sessionId;
|
|
219
222
|
clientName;
|
|
220
|
-
|
|
223
|
+
_clientVersion;
|
|
221
224
|
fileSystemService;
|
|
222
225
|
trackerService;
|
|
223
226
|
topicState = new TopicState();
|
|
@@ -228,6 +231,7 @@ export class Config {
|
|
|
228
231
|
sandbox;
|
|
229
232
|
_sandboxForbiddenPaths;
|
|
230
233
|
targetDir;
|
|
234
|
+
_ripgrepPathPromise;
|
|
231
235
|
workspaceContext;
|
|
232
236
|
debugMode;
|
|
233
237
|
question;
|
|
@@ -250,6 +254,7 @@ export class Config {
|
|
|
250
254
|
geminiMdFileCount;
|
|
251
255
|
geminiMdFilePaths;
|
|
252
256
|
showMemoryUsage;
|
|
257
|
+
logRagSnippets;
|
|
253
258
|
accessibility;
|
|
254
259
|
telemetrySettings;
|
|
255
260
|
usageStatisticsEnabled;
|
|
@@ -279,6 +284,7 @@ export class Config {
|
|
|
279
284
|
folderTrust;
|
|
280
285
|
ideMode;
|
|
281
286
|
_activeModel;
|
|
287
|
+
fallbackOverrides = new Map();
|
|
282
288
|
maxSessionTurns;
|
|
283
289
|
listSessions;
|
|
284
290
|
deleteSession;
|
|
@@ -346,12 +352,13 @@ export class Config {
|
|
|
346
352
|
gemmaModelRouter;
|
|
347
353
|
agentSessionNoninteractiveEnabled;
|
|
348
354
|
agentSessionInteractiveEnabled;
|
|
349
|
-
|
|
355
|
+
agentSessionSubagentEnabled;
|
|
350
356
|
retryFetchErrors;
|
|
351
357
|
maxAttempts;
|
|
352
358
|
enableShellOutputEfficiency;
|
|
353
359
|
shellToolInactivityTimeout;
|
|
354
360
|
fakeResponses;
|
|
361
|
+
fakeResponsesNonStrict;
|
|
355
362
|
recordResponses;
|
|
356
363
|
disableYoloMode;
|
|
357
364
|
disableAlwaysAllow;
|
|
@@ -377,8 +384,6 @@ export class Config {
|
|
|
377
384
|
skillsSupport;
|
|
378
385
|
disabledSkills;
|
|
379
386
|
adminSkillsEnabled;
|
|
380
|
-
experimentalJitContext;
|
|
381
|
-
experimentalMemoryV2;
|
|
382
387
|
experimentalAutoMemory;
|
|
383
388
|
experimentalGemma;
|
|
384
389
|
experimentalContextManagementConfig;
|
|
@@ -401,7 +406,7 @@ export class Config {
|
|
|
401
406
|
constructor(params) {
|
|
402
407
|
this._sessionId = params.sessionId;
|
|
403
408
|
this.clientName = params.clientName;
|
|
404
|
-
this.
|
|
409
|
+
this._clientVersion = params.clientVersion ?? 'unknown';
|
|
405
410
|
this.approvedPlanPath = undefined;
|
|
406
411
|
this.embeddingModel =
|
|
407
412
|
params.embeddingModel ?? DEFAULT_GEMINI_EMBEDDING_MODEL;
|
|
@@ -475,6 +480,7 @@ export class Config {
|
|
|
475
480
|
this.geminiMdFileCount = params.geminiMdFileCount ?? 0;
|
|
476
481
|
this.geminiMdFilePaths = params.geminiMdFilePaths ?? [];
|
|
477
482
|
this.showMemoryUsage = params.showMemoryUsage ?? false;
|
|
483
|
+
this.logRagSnippets = params.logRagSnippets ?? false;
|
|
478
484
|
this.accessibility = params.accessibility ?? {};
|
|
479
485
|
this.telemetrySettings = {
|
|
480
486
|
enabled: params.telemetry?.enabled ?? false,
|
|
@@ -571,10 +577,8 @@ export class Config {
|
|
|
571
577
|
};
|
|
572
578
|
}
|
|
573
579
|
this.modelConfigService = new ModelConfigService(modelConfigServiceConfig ?? DEFAULT_MODEL_CONFIGS);
|
|
574
|
-
this.experimentalJitContext = params.experimentalJitContext ?? true;
|
|
575
|
-
this.experimentalMemoryV2 = params.experimentalMemoryV2 ?? true;
|
|
576
580
|
this.experimentalAutoMemory = params.experimentalAutoMemory ?? false;
|
|
577
|
-
this.experimentalGemma = params.experimentalGemma ??
|
|
581
|
+
this.experimentalGemma = params.experimentalGemma ?? true;
|
|
578
582
|
this.experimentalContextManagementConfig =
|
|
579
583
|
params.experimentalContextManagementConfig;
|
|
580
584
|
this.memoryBoundaryMarkers = params.memoryBoundaryMarkers ?? ['.git'];
|
|
@@ -670,7 +674,6 @@ export class Config {
|
|
|
670
674
|
this.enableHooksUI = params.enableHooksUI ?? true;
|
|
671
675
|
this.enableHooks = params.enableHooks ?? true;
|
|
672
676
|
this.disabledHooks = params.disabledHooks ?? [];
|
|
673
|
-
this.continueOnFailedApiCall = params.continueOnFailedApiCall ?? true;
|
|
674
677
|
this.enableShellOutputEfficiency =
|
|
675
678
|
params.enableShellOutputEfficiency ?? true;
|
|
676
679
|
this.shellToolInactivityTimeout =
|
|
@@ -681,6 +684,7 @@ export class Config {
|
|
|
681
684
|
this.storage = new Storage(this.targetDir, this._sessionId);
|
|
682
685
|
this.storage.setCustomPlansDir(params.planSettings?.directory);
|
|
683
686
|
this.fakeResponses = params.fakeResponses;
|
|
687
|
+
this.fakeResponsesNonStrict = params.fakeResponsesNonStrict;
|
|
684
688
|
this.recordResponses = params.recordResponses;
|
|
685
689
|
this.fileExclusions = new FileExclusions(this);
|
|
686
690
|
this.eventEmitter = params.eventEmitter;
|
|
@@ -730,6 +734,8 @@ export class Config {
|
|
|
730
734
|
params.adk?.agentSessionNoninteractiveEnabled ?? false;
|
|
731
735
|
this.agentSessionInteractiveEnabled =
|
|
732
736
|
params.adk?.agentSessionInteractiveEnabled ?? false;
|
|
737
|
+
this.agentSessionSubagentEnabled =
|
|
738
|
+
params.adk?.agentSessionSubagentEnabled ?? false;
|
|
733
739
|
this.retryFetchErrors = params.retryFetchErrors ?? true;
|
|
734
740
|
this.maxAttempts = Math.min(params.maxAttempts ?? DEFAULT_MAX_ATTEMPTS, DEFAULT_MAX_ATTEMPTS);
|
|
735
741
|
this.disableYoloMode = params.disableYoloMode ?? false;
|
|
@@ -787,13 +793,26 @@ export class Config {
|
|
|
787
793
|
}
|
|
788
794
|
async _initialize() {
|
|
789
795
|
await this.storage.initialize();
|
|
796
|
+
ragLogger.initialize(this.storage.getProjectTempLogsDir());
|
|
790
797
|
// Add pending directories to workspace context
|
|
791
798
|
for (const dir of this.pendingIncludeDirectories) {
|
|
792
799
|
this.workspaceContext.addDirectory(dir);
|
|
793
800
|
}
|
|
794
801
|
// Add plans directory to workspace context for plan file storage
|
|
795
802
|
if (this.planEnabled) {
|
|
796
|
-
|
|
803
|
+
let plansDir;
|
|
804
|
+
try {
|
|
805
|
+
plansDir = this.storage.getPlansDir();
|
|
806
|
+
}
|
|
807
|
+
catch (error) {
|
|
808
|
+
// Fallback to the default plan dir if any error occurs
|
|
809
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
810
|
+
coreEvents.emitFeedback('warning', 'Invalid custom plans directory: ' +
|
|
811
|
+
errorMessage +
|
|
812
|
+
'. Falling back to default project temp directory.', error);
|
|
813
|
+
this.storage.setCustomPlansDir(undefined);
|
|
814
|
+
plansDir = this.storage.getPlansDir();
|
|
815
|
+
}
|
|
797
816
|
try {
|
|
798
817
|
await fs.promises.access(plansDir);
|
|
799
818
|
this.workspaceContext.addDirectory(plansDir);
|
|
@@ -856,10 +875,8 @@ export class Config {
|
|
|
856
875
|
this.hookSystem = new HookSystem(this);
|
|
857
876
|
await this.hookSystem.initialize();
|
|
858
877
|
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
await this.memoryContextManager.refresh();
|
|
862
|
-
}
|
|
878
|
+
this.memoryContextManager = new MemoryContextManager(this);
|
|
879
|
+
await this.memoryContextManager.refresh();
|
|
863
880
|
await this._geminiClient.initialize();
|
|
864
881
|
this.initialized = true;
|
|
865
882
|
}
|
|
@@ -869,6 +886,8 @@ export class Config {
|
|
|
869
886
|
async refreshAuth(authMethod, displayMessage, apiKey, baseUrl, customHeaders) {
|
|
870
887
|
// Reset availability service when switching auth
|
|
871
888
|
this.modelAvailabilityService.reset();
|
|
889
|
+
this.fallbackOverrides.clear();
|
|
890
|
+
this.modelConfigService.clearRuntimeOverrides();
|
|
872
891
|
// Vertex and Genai have incompatible encryption and sending history with
|
|
873
892
|
// thoughtSignature from Genai to Vertex will fail, we need to strip them
|
|
874
893
|
if (this.contentGeneratorConfig?.authType === AuthType.USE_GEMINI &&
|
|
@@ -1066,13 +1085,30 @@ export class Config {
|
|
|
1066
1085
|
this._sessionId = sessionId;
|
|
1067
1086
|
this.storage.setSessionId(sessionId);
|
|
1068
1087
|
this.trackerService = undefined;
|
|
1088
|
+
this.fallbackOverrides.clear();
|
|
1089
|
+
this.modelConfigService.clearRuntimeOverrides();
|
|
1090
|
+
this.approvedPlanPath = undefined;
|
|
1091
|
+
this.topicState.reset();
|
|
1092
|
+
this.skillManager.reset();
|
|
1093
|
+
this.latestApiRequest = undefined;
|
|
1094
|
+
this.lastModeSwitchTime = performance.now();
|
|
1095
|
+
this.compressionTruncationCounter = 0;
|
|
1096
|
+
this.quotaErrorOccurred = false;
|
|
1097
|
+
this.creditsNotificationShown = false;
|
|
1098
|
+
this.modelAvailabilityService.reset();
|
|
1099
|
+
this.modelQuotas.clear();
|
|
1100
|
+
this.lastRetrievedQuota = undefined;
|
|
1101
|
+
this.lastQuotaFetchTime = 0;
|
|
1102
|
+
// Force an event emission to clear the UI display
|
|
1103
|
+
coreEvents.emitQuotaChanged(undefined, undefined, undefined);
|
|
1104
|
+
this.lastEmittedQuotaRemaining = undefined;
|
|
1105
|
+
this.lastEmittedQuotaLimit = undefined;
|
|
1069
1106
|
if (previousPlansDir) {
|
|
1070
1107
|
this.refreshSessionScopedPlansDirectory(previousPlansDir);
|
|
1071
1108
|
}
|
|
1072
1109
|
}
|
|
1073
1110
|
resetNewSessionState(sessionId) {
|
|
1074
1111
|
this.setSessionId(sessionId);
|
|
1075
|
-
this.approvedPlanPath = undefined;
|
|
1076
1112
|
}
|
|
1077
1113
|
setTerminalBackground(terminalBackground) {
|
|
1078
1114
|
this.terminalBackground = terminalBackground;
|
|
@@ -1128,13 +1164,37 @@ export class Config {
|
|
|
1128
1164
|
}
|
|
1129
1165
|
this.modelAvailabilityService.reset();
|
|
1130
1166
|
}
|
|
1131
|
-
activateFallbackMode(model) {
|
|
1132
|
-
this.
|
|
1167
|
+
activateFallbackMode(model, failedModel) {
|
|
1168
|
+
if (this.getActiveModel() !== model) {
|
|
1169
|
+
this.setModel(model, true);
|
|
1170
|
+
}
|
|
1171
|
+
if (failedModel) {
|
|
1172
|
+
// Chained fallback mitigation: If we already have overrides that point to the model
|
|
1173
|
+
// that just failed, we need to update them to point to the new fallback model.
|
|
1174
|
+
// e.g. A -> B, then B fails and we fallback to C. We must update A to point to C.
|
|
1175
|
+
for (const [source, target] of this.fallbackOverrides.entries()) {
|
|
1176
|
+
if (target === failedModel) {
|
|
1177
|
+
this.fallbackOverrides.set(source, model);
|
|
1178
|
+
this.modelConfigService.registerRuntimeModelOverride({
|
|
1179
|
+
match: { model: source },
|
|
1180
|
+
modelConfig: { model },
|
|
1181
|
+
});
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
this.fallbackOverrides.set(failedModel, model);
|
|
1185
|
+
this.modelConfigService.registerRuntimeModelOverride({
|
|
1186
|
+
match: { model: failedModel },
|
|
1187
|
+
modelConfig: { model },
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1133
1190
|
const authType = this.getContentGeneratorConfig()?.authType;
|
|
1134
1191
|
if (authType) {
|
|
1135
1192
|
logFlashFallback(this, new FlashFallbackEvent(authType));
|
|
1136
1193
|
}
|
|
1137
1194
|
}
|
|
1195
|
+
getFallbackOverride(model) {
|
|
1196
|
+
return this.fallbackOverrides.get(model);
|
|
1197
|
+
}
|
|
1138
1198
|
getActiveModel() {
|
|
1139
1199
|
return this._activeModel ?? this.model;
|
|
1140
1200
|
}
|
|
@@ -1192,12 +1252,12 @@ export class Config {
|
|
|
1192
1252
|
}
|
|
1193
1253
|
getPooledQuota() {
|
|
1194
1254
|
const model = this.getModel();
|
|
1195
|
-
if (!isAutoModel(model)) {
|
|
1255
|
+
if (!isAutoModel(model, this)) {
|
|
1196
1256
|
return {};
|
|
1197
1257
|
}
|
|
1198
|
-
const
|
|
1199
|
-
|
|
1200
|
-
const proModel =
|
|
1258
|
+
const primaryModel = resolveModel(model, this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
1259
|
+
const isPreview = isPreviewModel(primaryModel, this);
|
|
1260
|
+
const proModel = primaryModel;
|
|
1201
1261
|
const flashModel = isPreview
|
|
1202
1262
|
? PREVIEW_GEMINI_FLASH_MODEL
|
|
1203
1263
|
: DEFAULT_GEMINI_FLASH_MODEL;
|
|
@@ -1222,7 +1282,7 @@ export class Config {
|
|
|
1222
1282
|
if (pooled.remaining !== undefined) {
|
|
1223
1283
|
return pooled.remaining;
|
|
1224
1284
|
}
|
|
1225
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
1285
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
1226
1286
|
return this.modelQuotas.get(primaryModel)?.remaining;
|
|
1227
1287
|
}
|
|
1228
1288
|
getQuotaLimit() {
|
|
@@ -1230,7 +1290,7 @@ export class Config {
|
|
|
1230
1290
|
if (pooled.limit !== undefined) {
|
|
1231
1291
|
return pooled.limit;
|
|
1232
1292
|
}
|
|
1233
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
1293
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
1234
1294
|
return this.modelQuotas.get(primaryModel)?.limit;
|
|
1235
1295
|
}
|
|
1236
1296
|
getQuotaResetTime() {
|
|
@@ -1238,7 +1298,7 @@ export class Config {
|
|
|
1238
1298
|
if (pooled.resetTime !== undefined) {
|
|
1239
1299
|
return pooled.resetTime;
|
|
1240
1300
|
}
|
|
1241
|
-
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.
|
|
1301
|
+
const primaryModel = resolveModel(this.getModel(), this.getGemini31LaunchedSync(), this.getUseCustomToolModelSync(), this.getHasAccessToPreviewModel(), this, this.hasGemini35FlashGAAccess());
|
|
1242
1302
|
return this.modelQuotas.get(primaryModel)?.resetTime;
|
|
1243
1303
|
}
|
|
1244
1304
|
getEmbeddingModel() {
|
|
@@ -1276,6 +1336,29 @@ export class Config {
|
|
|
1276
1336
|
getProjectRoot() {
|
|
1277
1337
|
return this.targetDir;
|
|
1278
1338
|
}
|
|
1339
|
+
/**
|
|
1340
|
+
* Returns the path to the ripgrep binary, or null if not found or unsafe.
|
|
1341
|
+
* Uses Promise-based caching to prevent race conditions and redundant I/O.
|
|
1342
|
+
*/
|
|
1343
|
+
async getRipgrepPath() {
|
|
1344
|
+
if (!this._ripgrepPathPromise) {
|
|
1345
|
+
this._ripgrepPathPromise = resolveRipgrepPath();
|
|
1346
|
+
}
|
|
1347
|
+
return this._ripgrepPathPromise;
|
|
1348
|
+
}
|
|
1349
|
+
/**
|
|
1350
|
+
* Checks if ripgrep is available.
|
|
1351
|
+
*/
|
|
1352
|
+
async canUseRipgrep() {
|
|
1353
|
+
return (await this.getRipgrepPath()) !== null;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* Resets the cached ripgrep path. Used for testing.
|
|
1357
|
+
* @internal
|
|
1358
|
+
*/
|
|
1359
|
+
__resetRipgrepPathCache() {
|
|
1360
|
+
this._ripgrepPathPromise = undefined;
|
|
1361
|
+
}
|
|
1279
1362
|
getWorkspaceContext() {
|
|
1280
1363
|
return getWorkspaceContextOverride() ?? this.workspaceContext;
|
|
1281
1364
|
}
|
|
@@ -1333,7 +1416,7 @@ export class Config {
|
|
|
1333
1416
|
return this.question;
|
|
1334
1417
|
}
|
|
1335
1418
|
getHasAccessToPreviewModel() {
|
|
1336
|
-
return this.hasAccessToPreviewModel
|
|
1419
|
+
return this.hasAccessToPreviewModel ?? false;
|
|
1337
1420
|
}
|
|
1338
1421
|
setHasAccessToPreviewModel(hasAccess) {
|
|
1339
1422
|
this.hasAccessToPreviewModel = hasAccess;
|
|
@@ -1389,10 +1472,12 @@ export class Config {
|
|
|
1389
1472
|
});
|
|
1390
1473
|
}
|
|
1391
1474
|
}
|
|
1392
|
-
this.emitQuotaChangedEvent();
|
|
1393
1475
|
}
|
|
1394
1476
|
const hasAccess = quota.buckets?.some((b) => b.modelId && isPreviewModel(b.modelId, this)) ?? false;
|
|
1395
1477
|
this.setHasAccessToPreviewModel(hasAccess);
|
|
1478
|
+
if (quota.buckets) {
|
|
1479
|
+
this.emitQuotaChangedEvent();
|
|
1480
|
+
}
|
|
1396
1481
|
return quota;
|
|
1397
1482
|
}
|
|
1398
1483
|
catch (e) {
|
|
@@ -1521,7 +1606,7 @@ export class Config {
|
|
|
1521
1606
|
this.mcpServers = mcpServers;
|
|
1522
1607
|
}
|
|
1523
1608
|
getUserMemory() {
|
|
1524
|
-
if (this.
|
|
1609
|
+
if (this.memoryContextManager) {
|
|
1525
1610
|
return {
|
|
1526
1611
|
global: this.memoryContextManager.getGlobalMemory(),
|
|
1527
1612
|
extension: this.memoryContextManager.getExtensionMemory(),
|
|
@@ -1535,13 +1620,7 @@ export class Config {
|
|
|
1535
1620
|
* Refreshes the MCP context, including memory, tools, and system instructions.
|
|
1536
1621
|
*/
|
|
1537
1622
|
async refreshMcpContext() {
|
|
1538
|
-
|
|
1539
|
-
await this.memoryContextManager.refresh();
|
|
1540
|
-
}
|
|
1541
|
-
else {
|
|
1542
|
-
const { refreshServerHierarchicalMemory } = await import('../utils/memoryDiscovery.js');
|
|
1543
|
-
await refreshServerHierarchicalMemory(this);
|
|
1544
|
-
}
|
|
1623
|
+
await this.memoryContextManager?.refresh();
|
|
1545
1624
|
if (this._geminiClient?.isInitialized()) {
|
|
1546
1625
|
await this._geminiClient.setTools();
|
|
1547
1626
|
this._geminiClient.updateSystemInstruction();
|
|
@@ -1551,15 +1630,14 @@ export class Config {
|
|
|
1551
1630
|
this.userMemory = newUserMemory;
|
|
1552
1631
|
}
|
|
1553
1632
|
/**
|
|
1554
|
-
* Returns memory for the system instruction.
|
|
1555
|
-
*
|
|
1556
|
-
* in the
|
|
1557
|
-
*
|
|
1558
|
-
*
|
|
1559
|
-
* via system instruction updates.
|
|
1633
|
+
* Returns Tier 1 memory for the system instruction. Global memory and user
|
|
1634
|
+
* project memory go in the system instruction; extension and project memory
|
|
1635
|
+
* are placed in the first user message instead, per the tiered context model.
|
|
1636
|
+
* User project memory is in Tier 1 so mid-session saves are reflected via
|
|
1637
|
+
* system instruction updates.
|
|
1560
1638
|
*/
|
|
1561
1639
|
getSystemInstructionMemory() {
|
|
1562
|
-
if (this.
|
|
1640
|
+
if (this.memoryContextManager) {
|
|
1563
1641
|
const global = this.memoryContextManager.getGlobalMemory();
|
|
1564
1642
|
const userProjectMemory = this.memoryContextManager.getUserProjectMemory();
|
|
1565
1643
|
if (userProjectMemory?.trim()) {
|
|
@@ -1571,15 +1649,17 @@ export class Config {
|
|
|
1571
1649
|
}
|
|
1572
1650
|
/**
|
|
1573
1651
|
* Returns Tier 2 memory (extension + project) for injection into the first
|
|
1574
|
-
* user message
|
|
1575
|
-
* disabled (Tier 2 memory is already in the system instruction).
|
|
1652
|
+
* user message.
|
|
1576
1653
|
*/
|
|
1577
|
-
getSessionMemory() {
|
|
1578
|
-
if (!this.
|
|
1654
|
+
getSessionMemory(options) {
|
|
1655
|
+
if (!this.memoryContextManager) {
|
|
1579
1656
|
return '';
|
|
1580
1657
|
}
|
|
1581
1658
|
const sections = [];
|
|
1582
|
-
const
|
|
1659
|
+
const includeExtensionContext = options?.includeExtensionContext ?? true;
|
|
1660
|
+
const extension = includeExtensionContext
|
|
1661
|
+
? this.memoryContextManager.getExtensionMemory()
|
|
1662
|
+
: '';
|
|
1583
1663
|
const project = this.memoryContextManager.getEnvironmentMemory();
|
|
1584
1664
|
if (extension?.trim()) {
|
|
1585
1665
|
sections.push(`<extension_context>\n${extension.trim()}\n</extension_context>`);
|
|
@@ -1600,18 +1680,15 @@ export class Config {
|
|
|
1600
1680
|
getMemoryContextManager() {
|
|
1601
1681
|
return this.memoryContextManager;
|
|
1602
1682
|
}
|
|
1603
|
-
isJitContextEnabled() {
|
|
1604
|
-
return this.experimentalJitContext;
|
|
1605
|
-
}
|
|
1606
1683
|
isContextManagementEnabled() {
|
|
1607
1684
|
return this.contextManagement.enabled;
|
|
1608
1685
|
}
|
|
1686
|
+
isAgentSessionSubagentEnabled() {
|
|
1687
|
+
return this.agentSessionSubagentEnabled;
|
|
1688
|
+
}
|
|
1609
1689
|
getMemoryBoundaryMarkers() {
|
|
1610
1690
|
return this.memoryBoundaryMarkers;
|
|
1611
1691
|
}
|
|
1612
|
-
isMemoryV2Enabled() {
|
|
1613
|
-
return this.experimentalMemoryV2;
|
|
1614
|
-
}
|
|
1615
1692
|
isAutoMemoryEnabled() {
|
|
1616
1693
|
return this.experimentalAutoMemory;
|
|
1617
1694
|
}
|
|
@@ -1667,7 +1744,7 @@ export class Config {
|
|
|
1667
1744
|
};
|
|
1668
1745
|
}
|
|
1669
1746
|
getGeminiMdFileCount() {
|
|
1670
|
-
if (this.
|
|
1747
|
+
if (this.memoryContextManager) {
|
|
1671
1748
|
return this.memoryContextManager.getLoadedPaths().size;
|
|
1672
1749
|
}
|
|
1673
1750
|
return this.geminiMdFileCount;
|
|
@@ -1676,7 +1753,7 @@ export class Config {
|
|
|
1676
1753
|
this.geminiMdFileCount = count;
|
|
1677
1754
|
}
|
|
1678
1755
|
getGeminiMdFilePaths() {
|
|
1679
|
-
if (this.
|
|
1756
|
+
if (this.memoryContextManager) {
|
|
1680
1757
|
return Array.from(this.memoryContextManager.getLoadedPaths());
|
|
1681
1758
|
}
|
|
1682
1759
|
return this.geminiMdFilePaths;
|
|
@@ -1726,21 +1803,23 @@ export class Config {
|
|
|
1726
1803
|
if (currentMode !== mode) {
|
|
1727
1804
|
this.logCurrentModeDuration(currentMode);
|
|
1728
1805
|
logApprovalModeSwitch(this, new ApprovalModeSwitchEvent(currentMode, mode));
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
if (
|
|
1738
|
-
this._geminiClient
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1806
|
+
this.policyEngine.setApprovalMode(mode);
|
|
1807
|
+
this.refreshSandboxManager();
|
|
1808
|
+
coreEvents.emit(CoreEvent.ApprovalModeChanged, {
|
|
1809
|
+
sessionId: this.getSessionId(),
|
|
1810
|
+
mode,
|
|
1811
|
+
});
|
|
1812
|
+
const isPlanModeTransition = currentMode === ApprovalMode.PLAN || mode === ApprovalMode.PLAN;
|
|
1813
|
+
const isYoloModeTransition = currentMode === ApprovalMode.YOLO || mode === ApprovalMode.YOLO;
|
|
1814
|
+
if (isPlanModeTransition || isYoloModeTransition) {
|
|
1815
|
+
if (this._geminiClient?.isInitialized()) {
|
|
1816
|
+
this._geminiClient.clearCurrentSequenceModel();
|
|
1817
|
+
this._geminiClient.setTools().catch((err) => {
|
|
1818
|
+
debugLogger.error('Failed to update tools', err);
|
|
1819
|
+
});
|
|
1820
|
+
}
|
|
1821
|
+
this.updateSystemInstructionIfInitialized();
|
|
1742
1822
|
}
|
|
1743
|
-
this.updateSystemInstructionIfInitialized();
|
|
1744
1823
|
}
|
|
1745
1824
|
}
|
|
1746
1825
|
/**
|
|
@@ -1769,6 +1848,9 @@ export class Config {
|
|
|
1769
1848
|
getExperimentalDynamicModelConfiguration() {
|
|
1770
1849
|
return this.dynamicModelConfiguration;
|
|
1771
1850
|
}
|
|
1851
|
+
getReleaseChannel() {
|
|
1852
|
+
return getChannelFromVersion(this._clientVersion);
|
|
1853
|
+
}
|
|
1772
1854
|
getPendingIncludeDirectories() {
|
|
1773
1855
|
return this.pendingIncludeDirectories;
|
|
1774
1856
|
}
|
|
@@ -1781,6 +1863,9 @@ export class Config {
|
|
|
1781
1863
|
getAccessibility() {
|
|
1782
1864
|
return this.accessibility;
|
|
1783
1865
|
}
|
|
1866
|
+
getLogRagSnippets() {
|
|
1867
|
+
return this.logRagSnippets;
|
|
1868
|
+
}
|
|
1784
1869
|
getTelemetryEnabled() {
|
|
1785
1870
|
return this.telemetrySettings.enabled ?? false;
|
|
1786
1871
|
}
|
|
@@ -2021,6 +2106,53 @@ export class Config {
|
|
|
2021
2106
|
setIdeMode(value) {
|
|
2022
2107
|
this.ideMode = value;
|
|
2023
2108
|
}
|
|
2109
|
+
isScopedMemoryInboxPatchPathAllowed(absolutePath, resolvedPath, inboxRoot, checkType = 'write') {
|
|
2110
|
+
if (!hasScopedMemoryInboxAccess()) {
|
|
2111
|
+
return false;
|
|
2112
|
+
}
|
|
2113
|
+
const normalizedPath = path.resolve(absolutePath);
|
|
2114
|
+
const resolvedMemoryRoot = resolveToRealPath(this.storage.getProjectMemoryTempDir());
|
|
2115
|
+
// Reads: allow the inbox root and the per-kind subtrees so the extraction
|
|
2116
|
+
// agent can list/inspect prior patches (including non-canonical filenames
|
|
2117
|
+
// left over from older runs) before deciding how to rewrite the canonical
|
|
2118
|
+
// extraction.patch. Writes still flow through the strict canonical-path
|
|
2119
|
+
// check below so the inbox cannot be backdoored with arbitrary files.
|
|
2120
|
+
if (checkType === 'read') {
|
|
2121
|
+
const resolvedInboxRoot = resolveToRealPath(inboxRoot);
|
|
2122
|
+
const normalizedInboxRoot = path.resolve(inboxRoot);
|
|
2123
|
+
if (resolvedPath === resolvedInboxRoot ||
|
|
2124
|
+
normalizedPath === normalizedInboxRoot) {
|
|
2125
|
+
return isSubpath(resolvedMemoryRoot, resolvedPath);
|
|
2126
|
+
}
|
|
2127
|
+
for (const kind of ['private', 'global']) {
|
|
2128
|
+
const kindRoot = path.join(inboxRoot, kind);
|
|
2129
|
+
const resolvedKindRoot = resolveToRealPath(kindRoot);
|
|
2130
|
+
const normalizedKindRoot = path.resolve(kindRoot);
|
|
2131
|
+
if (resolvedPath === resolvedKindRoot ||
|
|
2132
|
+
normalizedPath === normalizedKindRoot ||
|
|
2133
|
+
isSubpath(resolvedKindRoot, resolvedPath) ||
|
|
2134
|
+
isSubpath(normalizedKindRoot, normalizedPath)) {
|
|
2135
|
+
return isSubpath(resolvedMemoryRoot, resolvedPath);
|
|
2136
|
+
}
|
|
2137
|
+
}
|
|
2138
|
+
return false;
|
|
2139
|
+
}
|
|
2140
|
+
const isCanonicalPatchPath = ['private', 'global'].some((kind) => normalizedPath === path.resolve(inboxRoot, kind, 'extraction.patch'));
|
|
2141
|
+
if (!isCanonicalPatchPath) {
|
|
2142
|
+
return false;
|
|
2143
|
+
}
|
|
2144
|
+
return isSubpath(resolvedMemoryRoot, resolvedPath);
|
|
2145
|
+
}
|
|
2146
|
+
isScopedAutoMemoryExtractionWritePathAllowed(absolutePath, resolvedPath) {
|
|
2147
|
+
if (!hasScopedAutoMemoryExtractionWriteAccess()) {
|
|
2148
|
+
return false;
|
|
2149
|
+
}
|
|
2150
|
+
const resolvedSkillsMemoryDir = resolveToRealPath(this.storage.getProjectSkillsMemoryDir());
|
|
2151
|
+
if (isSubpath(resolvedSkillsMemoryDir, resolvedPath)) {
|
|
2152
|
+
return true;
|
|
2153
|
+
}
|
|
2154
|
+
return this.isScopedMemoryInboxPatchPathAllowed(absolutePath, resolvedPath, path.join(this.storage.getProjectMemoryTempDir(), '.inbox'));
|
|
2155
|
+
}
|
|
2024
2156
|
/**
|
|
2025
2157
|
* Get the current FileSystemService
|
|
2026
2158
|
*/
|
|
@@ -2034,11 +2166,37 @@ export class Config {
|
|
|
2034
2166
|
* file (the latter is the only file under `~/.cell-cli/` that is reachable —
|
|
2035
2167
|
* settings, credentials, keybindings, etc. remain disallowed).
|
|
2036
2168
|
*
|
|
2169
|
+
* One subtree is *carved back out*: `<projectMemoryDir>/.inbox/` is owned by
|
|
2170
|
+
* the auto-memory extraction agent and the `/memory inbox` review flow. The
|
|
2171
|
+
* main agent is denied access to it even though it falls inside the project
|
|
2172
|
+
* temp dir; the extraction agent receives a narrow execution-scoped exception
|
|
2173
|
+
* for *writes* to `.inbox/{private,global}/extraction.patch`. Scoped *read*
|
|
2174
|
+
* access to the wider `.inbox/{private,global}/` subtree is granted in
|
|
2175
|
+
* `validatePathAccess` so the extractor can enumerate prior patches.
|
|
2176
|
+
*
|
|
2037
2177
|
* @param absolutePath The absolute path to check.
|
|
2038
2178
|
* @returns true if the path is allowed, false otherwise.
|
|
2039
2179
|
*/
|
|
2040
2180
|
isPathAllowed(absolutePath) {
|
|
2041
2181
|
const resolvedPath = resolveToRealPath(absolutePath);
|
|
2182
|
+
// The auto-memory inbox (`<projectMemoryDir>/.inbox/`) is owned by the
|
|
2183
|
+
// background extraction agent and the `/memory inbox` review flow. The
|
|
2184
|
+
// main agent must NOT drop files into it directly (that would let the
|
|
2185
|
+
// model bypass review). Deny first, even if the path also satisfies the
|
|
2186
|
+
// workspace or project-temp allowlists below.
|
|
2187
|
+
const inboxRoot = path.join(this.storage.getProjectMemoryTempDir(), '.inbox');
|
|
2188
|
+
const resolvedInboxRoot = resolveToRealPath(inboxRoot);
|
|
2189
|
+
const normalizedPath = path.resolve(absolutePath);
|
|
2190
|
+
const normalizedInboxRoot = path.resolve(inboxRoot);
|
|
2191
|
+
if (resolvedPath === resolvedInboxRoot ||
|
|
2192
|
+
isSubpath(resolvedInboxRoot, resolvedPath) ||
|
|
2193
|
+
normalizedPath === normalizedInboxRoot ||
|
|
2194
|
+
isSubpath(normalizedInboxRoot, normalizedPath)) {
|
|
2195
|
+
if (this.isScopedMemoryInboxPatchPathAllowed(absolutePath, resolvedPath, inboxRoot)) {
|
|
2196
|
+
return true;
|
|
2197
|
+
}
|
|
2198
|
+
return false;
|
|
2199
|
+
}
|
|
2042
2200
|
const workspaceContext = this.getWorkspaceContext();
|
|
2043
2201
|
if (workspaceContext.isPathWithinWorkspace(resolvedPath)) {
|
|
2044
2202
|
return true;
|
|
@@ -2067,11 +2225,33 @@ export class Config {
|
|
|
2067
2225
|
* @returns An error message string if the path is disallowed, null otherwise.
|
|
2068
2226
|
*/
|
|
2069
2227
|
validatePathAccess(absolutePath, checkType = 'write') {
|
|
2228
|
+
const pathValidation = validatePath(absolutePath);
|
|
2229
|
+
if (!pathValidation.isValid) {
|
|
2230
|
+
return `Invalid path: ${pathValidation.error}`;
|
|
2231
|
+
}
|
|
2232
|
+
if (checkType === 'write' && hasScopedAutoMemoryExtractionWriteAccess()) {
|
|
2233
|
+
const resolvedPath = resolveToRealPath(absolutePath);
|
|
2234
|
+
if (this.isScopedAutoMemoryExtractionWritePathAllowed(absolutePath, resolvedPath)) {
|
|
2235
|
+
return null;
|
|
2236
|
+
}
|
|
2237
|
+
return `Auto-memory extraction write denied: Attempted path "${absolutePath}" is outside the extraction write allowlist. Extraction may only write extracted skills under ${this.storage.getProjectSkillsMemoryDir()} and canonical inbox patches under ${path.join(this.storage.getProjectMemoryTempDir(), '.inbox', '{private,global}', 'extraction.patch')}.`;
|
|
2238
|
+
}
|
|
2070
2239
|
// For read operations, check read-only paths first
|
|
2071
2240
|
if (checkType === 'read') {
|
|
2072
2241
|
if (this.getWorkspaceContext().isPathReadable(absolutePath)) {
|
|
2073
2242
|
return null;
|
|
2074
2243
|
}
|
|
2244
|
+
// The memory inbox is carved out of the standard temp-dir allowlist by
|
|
2245
|
+
// `isPathAllowed`. The extraction agent is granted a scoped read
|
|
2246
|
+
// exception so it can enumerate prior patches (including non-canonical
|
|
2247
|
+
// filenames) before consolidating them into the canonical
|
|
2248
|
+
// extraction.patch. Writes remain restricted to canonical paths.
|
|
2249
|
+
if (hasScopedMemoryInboxAccess()) {
|
|
2250
|
+
const inboxRoot = path.join(this.storage.getProjectMemoryTempDir(), '.inbox');
|
|
2251
|
+
if (this.isScopedMemoryInboxPatchPathAllowed(absolutePath, resolveToRealPath(absolutePath), inboxRoot, 'read')) {
|
|
2252
|
+
return null;
|
|
2253
|
+
}
|
|
2254
|
+
}
|
|
2075
2255
|
}
|
|
2076
2256
|
// Then check standard allowed paths (Workspace + Temp)
|
|
2077
2257
|
// This covers 'write' checks and acts as a fallback/temp-dir check for 'read'
|
|
@@ -2175,14 +2355,6 @@ export class Config {
|
|
|
2175
2355
|
await this.ensureExperimentsLoaded();
|
|
2176
2356
|
return this.getGemini31LaunchedSync();
|
|
2177
2357
|
}
|
|
2178
|
-
/**
|
|
2179
|
-
* Returns whether Gemini 3.1 Flash Lite has been launched.
|
|
2180
|
-
* This method is async and ensures that experiments are loaded before returning the result.
|
|
2181
|
-
*/
|
|
2182
|
-
async getGemini31FlashLiteLaunched() {
|
|
2183
|
-
await this.ensureExperimentsLoaded();
|
|
2184
|
-
return this.getGemini31FlashLiteLaunchedSync();
|
|
2185
|
-
}
|
|
2186
2358
|
/**
|
|
2187
2359
|
* Returns whether the custom tool model should be used.
|
|
2188
2360
|
*/
|
|
@@ -2203,10 +2375,44 @@ export class Config {
|
|
|
2203
2375
|
}
|
|
2204
2376
|
isGemini31LaunchedForAuthType(authType) {
|
|
2205
2377
|
return (authType === AuthType.USE_GEMINI ||
|
|
2378
|
+
authType === AuthType.LOGIN_WITH_GOOGLE ||
|
|
2206
2379
|
authType === AuthType.USE_VERTEX_AI ||
|
|
2207
2380
|
authType === AuthType.GATEWAY ||
|
|
2208
2381
|
authType === AuthType.KEYCLOAK);
|
|
2209
2382
|
}
|
|
2383
|
+
/**
|
|
2384
|
+
* Returns whether Gemini 3.5 Flash GA has been launched.
|
|
2385
|
+
*
|
|
2386
|
+
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
2387
|
+
*/
|
|
2388
|
+
hasGemini35FlashGAAccess() {
|
|
2389
|
+
const authType = this.contentGeneratorConfig?.authType;
|
|
2390
|
+
const hasAccess = (() => {
|
|
2391
|
+
if (this.isGemini31LaunchedForAuthType(authType)) {
|
|
2392
|
+
return true;
|
|
2393
|
+
}
|
|
2394
|
+
return (this.experiments?.flags[ExperimentFlags.GEMINI_3_5_FLASH_GA_LAUNCHED]
|
|
2395
|
+
?.boolValue ?? false);
|
|
2396
|
+
})();
|
|
2397
|
+
// Used to set default flash models based on access
|
|
2398
|
+
// TODO: Remove once the experiment for 3_5 flash rollut can be cleaned up.
|
|
2399
|
+
if (hasAccess) {
|
|
2400
|
+
// Gemini API key users should have the ability to manually select the
|
|
2401
|
+
// old preview flash model.
|
|
2402
|
+
if (authType === AuthType.USE_GEMINI ||
|
|
2403
|
+
authType === AuthType.LOGIN_WITH_GOOGLE ||
|
|
2404
|
+
authType === AuthType.KEYCLOAK) {
|
|
2405
|
+
setFlashModels('gemini-3-flash-preview', 'gemini-3.5-flash');
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
setFlashModels('gemini-3-flash', 'gemini-3-flash');
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
else {
|
|
2412
|
+
setFlashModels('gemini-3-flash-preview', 'gemini-2.5-flash');
|
|
2413
|
+
}
|
|
2414
|
+
return hasAccess;
|
|
2415
|
+
}
|
|
2210
2416
|
/**
|
|
2211
2417
|
* Returns whether Gemini 3.1 has been launched.
|
|
2212
2418
|
*
|
|
@@ -2236,19 +2442,10 @@ export class Config {
|
|
|
2236
2442
|
return undefined;
|
|
2237
2443
|
}
|
|
2238
2444
|
/**
|
|
2239
|
-
* Returns
|
|
2240
|
-
*
|
|
2241
|
-
* Note: This method should only be called after startup, once experiments have been loaded.
|
|
2242
|
-
* If you need to call this during startup or from an async context, use
|
|
2243
|
-
* getGemini31FlashLiteLaunched instead.
|
|
2445
|
+
* Returns the client version.
|
|
2244
2446
|
*/
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
if (this.isGemini31LaunchedForAuthType(authType)) {
|
|
2248
|
-
return true;
|
|
2249
|
-
}
|
|
2250
|
-
return (this.experiments?.flags[ExperimentFlags.GEMINI_3_1_FLASH_LITE_LAUNCHED]
|
|
2251
|
-
?.boolValue ?? false);
|
|
2447
|
+
get clientVersion() {
|
|
2448
|
+
return this._clientVersion;
|
|
2252
2449
|
}
|
|
2253
2450
|
async ensureExperimentsLoaded() {
|
|
2254
2451
|
if (!this.experimentsPromise) {
|
|
@@ -2338,9 +2535,6 @@ export class Config {
|
|
|
2338
2535
|
getSkipNextSpeakerCheck() {
|
|
2339
2536
|
return this.skipNextSpeakerCheck;
|
|
2340
2537
|
}
|
|
2341
|
-
getContinueOnFailedApiCall() {
|
|
2342
|
-
return this.continueOnFailedApiCall;
|
|
2343
|
-
}
|
|
2344
2538
|
getRetryFetchErrors() {
|
|
2345
2539
|
return this.retryFetchErrors;
|
|
2346
2540
|
}
|
|
@@ -2431,10 +2625,12 @@ export class Config {
|
|
|
2431
2625
|
return this.gemmaModelRouter;
|
|
2432
2626
|
}
|
|
2433
2627
|
getAgentSessionNoninteractiveEnabled() {
|
|
2434
|
-
return
|
|
2628
|
+
return (process.env['CELL_CLI_EXP_AGENT'] === 'true' ||
|
|
2629
|
+
this.agentSessionNoninteractiveEnabled);
|
|
2435
2630
|
}
|
|
2436
2631
|
getAgentSessionInteractiveEnabled() {
|
|
2437
|
-
return
|
|
2632
|
+
return (process.env['CELL_CLI_EXP_AGENT'] === 'true' ||
|
|
2633
|
+
this.agentSessionInteractiveEnabled);
|
|
2438
2634
|
}
|
|
2439
2635
|
/**
|
|
2440
2636
|
* Get override settings for a specific agent.
|
|
@@ -2504,7 +2700,7 @@ export class Config {
|
|
|
2504
2700
|
let useRipgrep = false;
|
|
2505
2701
|
let errorString = undefined;
|
|
2506
2702
|
try {
|
|
2507
|
-
useRipgrep = await canUseRipgrep();
|
|
2703
|
+
useRipgrep = await this.canUseRipgrep();
|
|
2508
2704
|
}
|
|
2509
2705
|
catch (error) {
|
|
2510
2706
|
errorString = String(error);
|
|
@@ -2531,9 +2727,6 @@ export class Config {
|
|
|
2531
2727
|
maybeRegister(ShellTool, () => registry.registerTool(new ShellTool(this, this.messageBus)));
|
|
2532
2728
|
maybeRegister(ListBackgroundProcessesTool, () => registry.registerTool(new ListBackgroundProcessesTool(this, this.messageBus)));
|
|
2533
2729
|
maybeRegister(ReadBackgroundOutputTool, () => registry.registerTool(new ReadBackgroundOutputTool(this, this.messageBus)));
|
|
2534
|
-
if (!this.isMemoryV2Enabled()) {
|
|
2535
|
-
maybeRegister(MemoryTool, () => registry.registerTool(new MemoryTool(this.messageBus, this.storage)));
|
|
2536
|
-
}
|
|
2537
2730
|
maybeRegister(WebSearchTool, () => registry.registerTool(new WebSearchTool(this, this.messageBus)));
|
|
2538
2731
|
maybeRegister(AskUserTool, () => registry.registerTool(new AskUserTool(this.messageBus)));
|
|
2539
2732
|
if (this.getUseWriteTodos()) {
|