ummaya 0.2.4 → 0.2.6
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/README.md +15 -2
- package/bin/ummaya +10 -1
- package/bun.lock +180 -244
- package/npm-shrinkwrap.json +760 -1760
- package/package.json +39 -22
- package/prompts/manifest.yaml +1 -1
- package/prompts/system_v1.md +1 -0
- package/pyproject.toml +27 -2
- package/specs/2803-document-production-hardening/contracts/document-tools.schema.json +1043 -0
- package/src/ummaya/_canonical/__init__.py +2 -0
- package/src/ummaya/_canonical/baselines.yaml +113 -0
- package/src/ummaya/engine/engine.py +29 -132
- package/src/ummaya/evidence/__init__.py +21 -2
- package/src/ummaya/evidence/dataset_contract.py +193 -0
- package/src/ummaya/evidence/document_authoring_cases.py +33 -0
- package/src/ummaya/evidence/document_harness.py +313 -0
- package/src/ummaya/evidence/document_viewer_ux.py +391 -0
- package/src/ummaya/evidence/gates.py +70 -0
- package/src/ummaya/evidence/json_types.py +20 -0
- package/src/ummaya/evidence/models.py +88 -1
- package/src/ummaya/evidence/output_payload.py +89 -0
- package/src/ummaya/evidence/payload_documents.py +233 -0
- package/src/ummaya/evidence/route_contracts.py +224 -0
- package/src/ummaya/evidence/route_helpers.py +150 -0
- package/src/ummaya/evidence/runner.py +81 -212
- package/src/ummaya/evidence/source_provenance.py +246 -0
- package/src/ummaya/evidence/source_provenance_redaction.py +176 -0
- package/src/ummaya/evidence/tool_layer.py +39 -0
- package/src/ummaya/evidence/tool_layer_models.py +151 -0
- package/src/ummaya/ipc/adapter_manifest_emitter.py +26 -10
- package/src/ummaya/ipc/document_intent_normalization.py +185 -0
- package/src/ummaya/ipc/frame_schema.py +5 -5
- package/src/ummaya/ipc/route_diagnostics.py +73 -0
- package/src/ummaya/ipc/stdio.py +1109 -477
- package/src/ummaya/llm/client.py +102 -3
- package/src/ummaya/llm/config.py +8 -3
- package/src/ummaya/primitives/__init__.py +6 -2
- package/src/ummaya/primitives/delegation.py +1 -1
- package/src/ummaya/primitives/document.py +28 -0
- package/src/ummaya/settings.py +0 -3
- package/src/ummaya/tools/discovery_bridge.py +17 -1
- package/src/ummaya/tools/documents/__init__.py +297 -0
- package/src/ummaya/tools/documents/adapter_registry.py +487 -0
- package/src/ummaya/tools/documents/archive_container_probe.py +167 -0
- package/src/ummaya/tools/documents/artifact_store.py +454 -0
- package/src/ummaya/tools/documents/authoring.py +283 -0
- package/src/ummaya/tools/documents/baselines.py +132 -0
- package/src/ummaya/tools/documents/capability.py +331 -0
- package/src/ummaya/tools/documents/contracts.py +112 -0
- package/src/ummaya/tools/documents/conversion.py +521 -0
- package/src/ummaya/tools/documents/diff.py +275 -0
- package/src/ummaya/tools/documents/engines.py +163 -0
- package/src/ummaya/tools/documents/evaluation.py +291 -0
- package/src/ummaya/tools/documents/explicit_values.py +108 -0
- package/src/ummaya/tools/documents/fixtures.py +174 -0
- package/src/ummaya/tools/documents/format_completion_audit.py +471 -0
- package/src/ummaya/tools/documents/formats/__init__.py +2 -0
- package/src/ummaya/tools/documents/formats/archive.py +528 -0
- package/src/ummaya/tools/documents/formats/base.py +41 -0
- package/src/ummaya/tools/documents/formats/code_file.py +211 -0
- package/src/ummaya/tools/documents/formats/data_file.py +272 -0
- package/src/ummaya/tools/documents/formats/hwp.py +284 -0
- package/src/ummaya/tools/documents/formats/hwpx.py +1837 -0
- package/src/ummaya/tools/documents/formats/odf.py +435 -0
- package/src/ummaya/tools/documents/formats/ooxml.py +1030 -0
- package/src/ummaya/tools/documents/formats/passive.py +766 -0
- package/src/ummaya/tools/documents/formats/pdf.py +702 -0
- package/src/ummaya/tools/documents/formats/text_web.py +268 -0
- package/src/ummaya/tools/documents/hwp_conversion_probe.py +178 -0
- package/src/ummaya/tools/documents/hwp_direct_candidate.py +141 -0
- package/src/ummaya/tools/documents/inspection.py +289 -0
- package/src/ummaya/tools/documents/intake.py +1079 -0
- package/src/ummaya/tools/documents/legacy_office_promotion_probe.py +366 -0
- package/src/ummaya/tools/documents/models.py +1598 -0
- package/src/ummaya/tools/documents/odf_promotion_probe.py +167 -0
- package/src/ummaya/tools/documents/orchestrator.py +96 -0
- package/src/ummaya/tools/documents/passive_capability_probe.py +251 -0
- package/src/ummaya/tools/documents/patch.py +170 -0
- package/src/ummaya/tools/documents/pdfa_conformance.py +284 -0
- package/src/ummaya/tools/documents/pdfa_promotion_probe.py +198 -0
- package/src/ummaya/tools/documents/permissions.py +110 -0
- package/src/ummaya/tools/documents/planner.py +616 -0
- package/src/ummaya/tools/documents/registry.py +2733 -0
- package/src/ummaya/tools/documents/render.py +978 -0
- package/src/ummaya/tools/documents/render_comparison.py +113 -0
- package/src/ummaya/tools/documents/render_comparison_models.py +74 -0
- package/src/ummaya/tools/documents/render_comparison_regions.py +73 -0
- package/src/ummaya/tools/documents/render_comparison_style.py +161 -0
- package/src/ummaya/tools/documents/reread.py +157 -0
- package/src/ummaya/tools/documents/runtime_authoring.py +244 -0
- package/src/ummaya/tools/documents/runtime_authoring_bundle.py +76 -0
- package/src/ummaya/tools/documents/scorecard.py +184 -0
- package/src/ummaya/tools/documents/socratic_planner.py +193 -0
- package/src/ummaya/tools/documents/style.py +48 -0
- package/src/ummaya/tools/documents/tool_defs.py +523 -0
- package/src/ummaya/tools/documents/validate.py +347 -0
- package/src/ummaya/tools/executor.py +29 -0
- package/src/ummaya/tools/live_proxy.py +0 -3
- package/src/ummaya/tools/models.py +5 -1
- package/src/ummaya/tools/register_all.py +8 -0
- package/src/ummaya/tools/registry.py +10 -1
- package/src/ummaya/tools/routing/__init__.py +59 -0
- package/src/ummaya/tools/routing/builder.py +105 -0
- package/src/ummaya/tools/routing/cards.py +29 -0
- package/src/ummaya/tools/routing/decision_service.py +534 -0
- package/src/ummaya/tools/routing/decision_types.py +74 -0
- package/src/ummaya/tools/routing/feasibility.py +122 -0
- package/src/ummaya/tools/routing/intent.py +17 -0
- package/src/ummaya/tools/routing/intent_extractor.py +207 -0
- package/src/ummaya/tools/routing/intent_patterns.py +160 -0
- package/src/ummaya/tools/routing/intent_public_data.py +150 -0
- package/src/ummaya/tools/routing/intent_types.py +48 -0
- package/src/ummaya/tools/routing/lint.py +78 -0
- package/src/ummaya/tools/routing/metadata.py +174 -0
- package/src/ummaya/tools/routing/projection.py +340 -0
- package/src/ummaya/tools/routing/retrieval_policy.py +629 -0
- package/src/ummaya/tools/routing/schema.py +81 -0
- package/src/ummaya/tools/routing/types.py +96 -0
- package/src/ummaya/tools/routing_index.py +2 -2
- package/src/ummaya/tools/search.py +34 -746
- package/tests/fixtures/documents/public_forms/baselines.yaml +113 -0
- package/tui/bun.lock +126 -305
- package/tui/package.json +35 -22
- package/tui/src/.cc-byte-identical-whitelist.yaml +266 -0
- package/tui/src/QueryEngine.ts +12 -8
- package/tui/src/bridge/inboundAttachments.ts +3 -3
- package/tui/src/cli/handlers/auth.ts +3 -12
- package/tui/src/cli/handlers/mcp.tsx +0 -1
- package/tui/src/cli/print.ts +8 -9
- package/tui/src/commands/insights.ts +1 -1
- package/tui/src/commands/install-github-app/types.ts +8 -30
- package/tui/src/commands/plugin/types.ts +6 -28
- package/tui/src/commands/plugin/unifiedTypes.ts +4 -26
- package/tui/src/commands/rename/generateSessionName.ts +1 -1
- package/tui/src/components/Feedback.tsx +1 -1
- package/tui/src/components/LogoV2/EmergencyTip.tsx +11 -2
- package/tui/src/components/LogoV2/WelcomeV2.tsx +1 -3
- package/tui/src/components/ScrollKeybindingHandler.tsx +6 -6
- package/tui/src/components/Spinner/types.ts +6 -28
- package/tui/src/components/agents/generateAgent.ts +1 -1
- package/tui/src/components/agents/new-agent-creation/types.ts +4 -26
- package/tui/src/components/config/EnvSecretIsolatedEditor.tsx +1 -1
- package/tui/src/components/mcp/types.ts +16 -38
- package/tui/src/components/messages/AssistantToolUseMessage.tsx +3 -2
- package/tui/src/components/messages/UserCrossSessionMessage.ts +16 -4
- package/tui/src/components/messages/UserForkBoilerplateMessage.ts +16 -4
- package/tui/src/components/messages/UserGitHubWebhookMessage.ts +16 -4
- package/tui/src/components/messages/UserToolResultMessage/utils.tsx +3 -2
- package/tui/src/components/permissions/MonitorPermissionRequest/MonitorPermissionRequest.ts +9 -4
- package/tui/src/components/permissions/ReviewArtifactPermissionRequest/ReviewArtifactPermissionRequest.ts +9 -4
- package/tui/src/components/primitive/DocumentSocraticReviewBlock.tsx +129 -0
- package/tui/src/components/primitive/DocumentToolResultCard.tsx +224 -0
- package/tui/src/components/primitive/documentSocraticReview.ts +215 -0
- package/tui/src/components/primitive/index.tsx +43 -1
- package/tui/src/components/primitive/types.ts +137 -0
- package/tui/src/components/ui/option.ts +4 -26
- package/tui/src/constants/common.ts +0 -2
- package/tui/src/constants/prompts.ts +4 -3
- package/tui/src/constants/querySource.ts +4 -26
- package/tui/src/entrypoints/sdk/controlTypes.ts +26 -48
- package/tui/src/entrypoints/sdk/coreTypes.generated.ts +3 -25
- package/tui/src/entrypoints/sdk/runtimeTypes.ts +38 -60
- package/tui/src/entrypoints/sdk/sdkUtilityTypes.ts +4 -26
- package/tui/src/entrypoints/sdk/settingsTypes.generated.ts +3 -25
- package/tui/src/entrypoints/sdk/toolTypes.ts +3 -25
- package/tui/src/hooks/toolPermission/handlers/interactiveHandler.ts +10 -0
- package/tui/src/hooks/useApiKeyVerification.ts +1 -1
- package/tui/src/hooks/useVirtualScroll.ts +1 -1
- package/tui/src/ink/ink.tsx +33 -14
- package/tui/src/ink/reconciler.ts +2 -3
- package/tui/src/ink/render-to-screen.ts +30 -10
- package/tui/src/ipc/bridge.ts +62 -15
- package/tui/src/ipc/bridgeSingleton.ts +5 -1
- package/tui/src/ipc/codec.ts +3 -3
- package/tui/src/ipc/frames.generated.ts +12 -12
- package/tui/src/ipc/llmClient.ts +151 -27
- package/tui/src/ipc/schema/frame.schema.json +1 -1
- package/tui/src/keybindings/defaultBindings.ts +4 -0
- package/tui/src/main.tsx +32 -15
- package/tui/src/native-ts/file-index/index.ts +33 -3
- package/tui/src/observability/surface.ts +2 -2
- package/tui/src/probes/toolRegistryProbe.tsx +3 -1
- package/tui/src/projectOnboardingState.ts +7 -6
- package/tui/src/query/chatMessageTypes.ts +18 -0
- package/tui/src/query/chatMessagesBuilder.ts +1 -1
- package/tui/src/query/deps.ts +1 -1
- package/tui/src/query/messageGuards.ts +106 -0
- package/tui/src/query/publicDataTerminalRepair.ts +384 -0
- package/tui/src/query/run.ts +1075 -0
- package/tui/src/query/supportBoundary.ts +168 -0
- package/tui/src/query/toolResultErrors.ts +103 -0
- package/tui/src/query/toolRunner.ts +687 -0
- package/tui/src/query/unavailableToolRepair.ts +118 -0
- package/tui/src/query.ts +9 -2186
- package/tui/src/screens/REPL.tsx +40 -29
- package/tui/src/services/api/adapterManifest.ts +4 -0
- package/tui/src/services/api/backendChat/events.ts +117 -0
- package/tui/src/services/api/backendChat/finalMessage.ts +40 -0
- package/tui/src/services/api/backendChat/frame.ts +9 -0
- package/tui/src/services/api/backendChat/streaming.ts +430 -0
- package/tui/src/services/api/backendChat/types.ts +62 -0
- package/tui/src/services/api/backendChat.ts +1 -0
- package/tui/src/services/api/client.ts +65 -2
- package/tui/src/services/api/errorUtils.ts +5 -5
- package/tui/src/services/api/errors.ts +1 -1
- package/tui/src/services/api/logging.ts +1 -1
- package/tui/src/services/api/ummaya/evidence.ts +194 -0
- package/tui/src/services/api/ummaya/messages.ts +255 -0
- package/tui/src/services/api/ummaya/nonStreaming.ts +66 -0
- package/tui/src/services/api/ummaya/provider.ts +200 -0
- package/tui/src/services/api/ummaya/reasoning.ts +24 -0
- package/tui/src/services/api/ummaya/request.ts +200 -0
- package/tui/src/services/api/ummaya/selectionContext.ts +240 -0
- package/tui/src/services/api/ummaya/streaming.ts +365 -0
- package/tui/src/services/api/ummaya/streamingPayload.ts +129 -0
- package/tui/src/services/api/ummaya/streamingReader.ts +40 -0
- package/tui/src/services/api/ummaya/toolSelection.ts +217 -0
- package/tui/src/services/api/ummaya/types.ts +110 -0
- package/tui/src/services/api/ummaya/usage.ts +30 -0
- package/tui/src/services/api/ummaya.ts +26 -418
- package/tui/src/services/api/withRetry.ts +1 -1
- package/tui/src/services/awaySummary.ts +2 -2
- package/tui/src/services/claudeAiLimits.ts +1 -1
- package/tui/src/services/compact/autoCompact.ts +1 -1
- package/tui/src/services/compact/compact.ts +1 -1
- package/tui/src/services/lsp/types.ts +8 -30
- package/tui/src/services/tips/types.ts +6 -28
- package/tui/src/services/tokenEstimation.ts +1 -1
- package/tui/src/services/toolRegistry/bootGuard.ts +5 -5
- package/tui/src/services/toolUseSummary/toolUseSummaryGenerator.ts +1 -1
- package/tui/src/services/tools/toolExecution.ts +94 -1
- package/tui/src/store/pendingPermissionSlot.ts +1 -1
- package/tui/src/store/session-store.ts +10 -36
- package/tui/src/stubs/any-stub.ts +15 -10
- package/tui/src/stubs/color-diff-napi.ts +37 -23
- package/tui/src/stubs/globals.d.ts +3 -3
- package/tui/src/stubs/macro-preload.ts +23 -12
- package/tui/src/tools/AdapterTool/AdapterTool.ts +1207 -714
- package/tui/src/tools/AdapterTool/routeDiagnostics.ts +75 -0
- package/tui/src/tools/AgentTool/AgentTool.tsx +84 -1371
- package/tui/src/tools/AgentTool/agentToolHandoff.ts +114 -0
- package/tui/src/tools/AgentTool/agentToolPartialResult.ts +16 -0
- package/tui/src/tools/AgentTool/agentToolProgress.ts +32 -0
- package/tui/src/tools/AgentTool/agentToolResolver.ts +161 -0
- package/tui/src/tools/AgentTool/agentToolResult.ts +163 -0
- package/tui/src/tools/AgentTool/agentToolUtils.ts +14 -686
- package/tui/src/tools/AgentTool/asyncAgentLifecycle.ts +208 -0
- package/tui/src/tools/AgentTool/asyncLifecycle.ts +153 -0
- package/tui/src/tools/AgentTool/backgroundedCompletion.ts +126 -0
- package/tui/src/tools/AgentTool/backgroundedLifecycle.ts +174 -0
- package/tui/src/tools/AgentTool/foregroundBackground.ts +83 -0
- package/tui/src/tools/AgentTool/foregroundDrain.tsx +133 -0
- package/tui/src/tools/AgentTool/foregroundFinalize.ts +98 -0
- package/tui/src/tools/AgentTool/foregroundLifecycle.tsx +237 -0
- package/tui/src/tools/AgentTool/foregroundProgress.tsx +169 -0
- package/tui/src/tools/AgentTool/foregroundTask.ts +89 -0
- package/tui/src/tools/AgentTool/forkSubagent.ts +1 -12
- package/tui/src/tools/AgentTool/forkSubagentGate.ts +34 -0
- package/tui/src/tools/AgentTool/launchRouting.ts +203 -0
- package/tui/src/tools/AgentTool/lifecycle.ts +244 -0
- package/tui/src/tools/AgentTool/mcpRouting.ts +73 -0
- package/tui/src/tools/AgentTool/orchestrationSupport.ts +70 -0
- package/tui/src/tools/AgentTool/permissions.ts +39 -0
- package/tui/src/tools/AgentTool/promptSetup.ts +181 -0
- package/tui/src/tools/AgentTool/remoteRouting.ts +62 -0
- package/tui/src/tools/AgentTool/resultMapping.ts +116 -0
- package/tui/src/tools/AgentTool/resumeAgent.ts +39 -107
- package/tui/src/tools/AgentTool/resumeAgentHelpers.ts +140 -0
- package/tui/src/tools/AgentTool/runAgent.ts +1 -1
- package/tui/src/tools/AgentTool/runtimeConfig.ts +57 -0
- package/tui/src/tools/AgentTool/schemas.ts +196 -0
- package/tui/src/tools/AgentTool/sourceVerificationPropagation.ts +263 -0
- package/tui/src/tools/AgentTool/worktreeLifecycle.ts +105 -0
- package/tui/src/tools/AskUserQuestionTool/AskUserQuestionTool.tsx +174 -202
- package/tui/src/tools/BashTool/BashTool.tsx +71 -1072
- package/tui/src/tools/BashTool/bashCommandHelpers.ts +12 -12
- package/tui/src/tools/BashTool/bashPermissions/astPreflight.ts +173 -0
- package/tui/src/tools/BashTool/bashPermissions/classifierChecks.ts +199 -0
- package/tui/src/tools/BashTool/bashPermissions/compoundGuards.ts +53 -0
- package/tui/src/tools/BashTool/bashPermissions/constants.ts +99 -0
- package/tui/src/tools/BashTool/bashPermissions/index.ts +38 -0
- package/tui/src/tools/BashTool/bashPermissions/legacyMisparsing.ts +62 -0
- package/tui/src/tools/BashTool/bashPermissions/main.ts +135 -0
- package/tui/src/tools/BashTool/bashPermissions/normalizedCommands.ts +33 -0
- package/tui/src/tools/BashTool/bashPermissions/operatorFlow.ts +98 -0
- package/tui/src/tools/BashTool/bashPermissions/permissionChecks.ts +200 -0
- package/tui/src/tools/BashTool/bashPermissions/prefixSuggestions.ts +88 -0
- package/tui/src/tools/BashTool/bashPermissions/promptClassifierRules.ts +125 -0
- package/tui/src/tools/BashTool/bashPermissions/ruleDelegates.ts +19 -0
- package/tui/src/tools/BashTool/bashPermissions/ruleMatching.ts +145 -0
- package/tui/src/tools/BashTool/bashPermissions/sandboxAutoAllow.ts +75 -0
- package/tui/src/tools/BashTool/bashPermissions/subcommandFlow.ts +205 -0
- package/tui/src/tools/BashTool/bashPermissions/subcommandGuards.ts +73 -0
- package/tui/src/tools/BashTool/bashPermissions/subcommandResultHelpers.ts +116 -0
- package/tui/src/tools/BashTool/bashPermissions/types.ts +26 -0
- package/tui/src/tools/BashTool/bashPermissions/wrapperStripping.ts +139 -0
- package/tui/src/tools/BashTool/bashPermissions.ts +26 -2621
- package/tui/src/tools/BashTool/call.ts +202 -0
- package/tui/src/tools/BashTool/callLoader.ts +35 -0
- package/tui/src/tools/BashTool/commandClassification.ts +151 -0
- package/tui/src/tools/BashTool/commandClassificationLoader.ts +40 -0
- package/tui/src/tools/BashTool/cwdReset.ts +33 -0
- package/tui/src/tools/BashTool/lineTruncation.ts +11 -0
- package/tui/src/tools/BashTool/modeValidation.ts +13 -1
- package/tui/src/tools/BashTool/outputPersistence.ts +42 -0
- package/tui/src/tools/BashTool/permissionClassification.ts +66 -0
- package/tui/src/tools/BashTool/permissionLoader.ts +44 -0
- package/tui/src/tools/BashTool/resultLoader.ts +29 -0
- package/tui/src/tools/BashTool/resultMapping.ts +83 -0
- package/tui/src/tools/BashTool/sandboxPolicy.ts +79 -0
- package/tui/src/tools/BashTool/schemas.ts +65 -0
- package/tui/src/tools/BashTool/sedEditExecution.ts +59 -0
- package/tui/src/tools/BashTool/shellExecution.tsx +245 -0
- package/tui/src/tools/BashTool/shellOutputUtils.ts +85 -0
- package/tui/src/tools/BashTool/shellPermissionGauntlet.ts +97 -0
- package/tui/src/tools/BashTool/uiLoader.ts +37 -0
- package/tui/src/tools/BriefTool/upload.ts +1 -1
- package/tui/src/tools/CalculatorTool/parser.ts +2 -2
- package/tui/src/tools/DocumentPrimitive/DocumentPrimitive.ts +262 -0
- package/tui/src/tools/DocumentPrimitive/dispatchNormalization.ts +270 -0
- package/tui/src/tools/DocumentPrimitive/documentDestinationPath.ts +18 -0
- package/tui/src/tools/DocumentPrimitive/documentMutationGuard.ts +22 -0
- package/tui/src/tools/DocumentPrimitive/documentPatchNormalization.ts +248 -0
- package/tui/src/tools/DocumentPrimitive/documentSourceVerification.ts +245 -0
- package/tui/src/tools/DocumentPrimitive/documentSourceVerificationFields.ts +103 -0
- package/tui/src/tools/DocumentPrimitive/modelVisibleOutput.ts +40 -0
- package/tui/src/tools/DocumentPrimitive/prompt.ts +35 -0
- package/tui/src/tools/FileEditTool/FileEditTool.ts +9 -507
- package/tui/src/tools/FileEditTool/call.ts +228 -0
- package/tui/src/tools/FileEditTool/validateInput.ts +196 -0
- package/tui/src/tools/FileReadTool/imageProcessor.ts +13 -0
- package/tui/src/tools/FileWriteTool/FileWriteTool.ts +7 -300
- package/tui/src/tools/FileWriteTool/call.ts +223 -0
- package/tui/src/tools/FileWriteTool/validateInput.ts +80 -0
- package/tui/src/tools/ListMcpResourcesTool/ListMcpResourcesTool.ts +19 -3
- package/tui/src/tools/LookupPrimitive/LookupPrimitive.ts +25 -32
- package/tui/src/tools/LookupPrimitive/prompt.ts +0 -2
- package/tui/src/tools/MCPTool/trustPolicy.ts +118 -0
- package/tui/src/tools/McpAuthTool/McpAuthTool.ts +21 -3
- package/tui/src/tools/NotebookEditTool/NotebookEditTool.ts +7 -326
- package/tui/src/tools/NotebookEditTool/call.ts +254 -0
- package/tui/src/tools/NotebookEditTool/notebookModel.ts +51 -0
- package/tui/src/tools/NotebookEditTool/validateInput.ts +142 -0
- package/tui/src/tools/PowerShellTool/PowerShellTool.tsx +46 -937
- package/tui/src/tools/PowerShellTool/acceptEditsCommandValidation.ts +162 -0
- package/tui/src/tools/PowerShellTool/call.ts +179 -0
- package/tui/src/tools/PowerShellTool/callLoader.ts +37 -0
- package/tui/src/tools/PowerShellTool/commandClassification.ts +86 -0
- package/tui/src/tools/PowerShellTool/modeValidation.ts +25 -332
- package/tui/src/tools/PowerShellTool/outputPersistence.ts +42 -0
- package/tui/src/tools/PowerShellTool/permissionClassification.ts +28 -0
- package/tui/src/tools/PowerShellTool/resultLoader.ts +31 -0
- package/tui/src/tools/PowerShellTool/resultMapping.ts +75 -0
- package/tui/src/tools/PowerShellTool/schemas.ts +40 -0
- package/tui/src/tools/PowerShellTool/shellExecution.tsx +258 -0
- package/tui/src/tools/PowerShellTool/symlinkModeValidation.ts +44 -0
- package/tui/src/tools/PowerShellTool/uiLoader.ts +37 -0
- package/tui/src/tools/PowerShellTool/validation.ts +39 -0
- package/tui/src/tools/ReadMcpResourceTool/ReadMcpResourceTool.ts +19 -3
- package/tui/src/tools/ResolveLocationPrimitive/ResolveLocationPrimitive.ts +1 -11
- package/tui/src/tools/ResolveLocationPrimitive/prompt.ts +2 -6
- package/tui/src/tools/SkillTool/SkillTool.ts +2 -2
- package/tui/src/tools/SubmitPrimitive/SubmitPrimitive.ts +27 -10
- package/tui/src/tools/TaskCreateTool/TaskCreateTool.ts +16 -2
- package/tui/src/tools/TaskGetTool/TaskGetTool.ts +23 -3
- package/tui/src/tools/TaskListTool/TaskListTool.ts +22 -4
- package/tui/src/tools/TaskOutputTool/TaskOutputTool.tsx +46 -547
- package/tui/src/tools/TaskOutputTool/lookup.ts +216 -0
- package/tui/src/tools/TaskOutputTool/render.tsx +257 -0
- package/tui/src/tools/TaskOutputTool/schemas.ts +55 -0
- package/tui/src/tools/TaskOutputTool/serialization.ts +36 -0
- package/tui/src/tools/TaskStopTool/TaskStopTool.ts +10 -0
- package/tui/src/tools/TaskUpdateTool/TaskUpdateTool.ts +14 -364
- package/tui/src/tools/TaskUpdateTool/completion.ts +62 -0
- package/tui/src/tools/TaskUpdateTool/schemas.ts +62 -0
- package/tui/src/tools/TaskUpdateTool/serialization.ts +46 -0
- package/tui/src/tools/TaskUpdateTool/statusUpdate.ts +247 -0
- package/tui/src/tools/TodoWriteTool/TodoWriteTool.ts +21 -2
- package/tui/src/tools/ToolSearchTool/ToolSearchTool.ts +21 -302
- package/tui/src/tools/ToolSearchTool/ccSupportTools.ts +223 -0
- package/tui/src/tools/ToolSearchTool/descriptionCache.ts +50 -0
- package/tui/src/tools/ToolSearchTool/keywordSearch.ts +216 -0
- package/tui/src/tools/ToolSearchTool/prompt.ts +10 -4
- package/tui/src/tools/ToolSearchTool/resultMapping.ts +30 -0
- package/tui/src/tools/ToolSearchTool/schemas.ts +30 -0
- package/tui/src/tools/ToolSearchTool/searchPool.ts +47 -0
- package/tui/src/tools/ToolSearchTool/supportIntentHints.ts +140 -0
- package/tui/src/tools/TranslateTool/TranslateTool.ts +1 -1
- package/tui/src/tools/VerifyPrimitive/VerifyPrimitive.ts +2 -1
- package/tui/src/tools/WebFetchTool/WebFetchTool.ts +43 -138
- package/tui/src/tools/WebFetchTool/call.ts +227 -0
- package/tui/src/tools/WebFetchTool/resolvedAddressSafety.ts +78 -0
- package/tui/src/tools/WebFetchTool/sourceVerification.ts +204 -0
- package/tui/src/tools/WebFetchTool/types.ts +23 -0
- package/tui/src/tools/WebFetchTool/urlSafety.ts +181 -0
- package/tui/src/tools/WebFetchTool/utils.ts +1 -1
- package/tui/src/tools/WebSearchTool/UI.tsx +0 -1
- package/tui/src/tools/WebSearchTool/WebSearchTool.ts +9 -313
- package/tui/src/tools/WebSearchTool/call.ts +33 -0
- package/tui/src/tools/WebSearchTool/responseMapping.ts +190 -0
- package/tui/src/tools/WebSearchTool/resultBlock.ts +47 -0
- package/tui/src/tools/WebSearchTool/schemas.ts +47 -0
- package/tui/src/tools/WebSearchTool/toolSchema.ts +12 -0
- package/tui/src/tools/WorkspaceToolAdapter/WorkspaceToolAdapter.ts +79 -0
- package/tui/src/tools/WorkspaceToolAdapter/allowedRootPolicy.ts +85 -0
- package/tui/src/tools/WorkspaceToolAdapter/documentFormatGuards.ts +73 -0
- package/tui/src/tools/WorkspaceToolAdapter/inputNormalization.ts +105 -0
- package/tui/src/tools/WorkspaceToolAdapter/mcpExposurePolicy.ts +64 -0
- package/tui/src/tools/WorkspaceToolAdapter/toolDefFactory.ts +215 -0
- package/tui/src/tools/WorkspaceToolAdapter/toolNames.ts +6 -0
- package/tui/src/tools/WorkspaceToolAdapter/workspacePolicy.ts +15 -0
- package/tui/src/tools/_shared/dispatchPrimitive.ts +6 -6
- package/tui/src/tools/_shared/documentChangeToPatch.ts +125 -0
- package/tui/src/tools/_shared/documentDispatchArguments.ts +87 -0
- package/tui/src/tools/_shared/documentPrimitiveTimeout.ts +13 -0
- package/tui/src/tools/_shared/documentToolResultRender.ts +98 -0
- package/tui/src/tools/_shared/pendingCallRegistry.ts +1 -6
- package/tui/src/tools/_shared/rootPrimitiveInput.ts +1 -0
- package/tui/src/tools/_shared/toolChoiceRepair/documentCompletionPatterns.ts +58 -0
- package/tui/src/tools/_shared/toolChoiceRepair/documentCompletionPrompt.ts +271 -0
- package/tui/src/tools/_shared/toolChoiceRepair/documentRepair.ts +452 -0
- package/tui/src/tools/_shared/toolChoiceRepair/messageAccess.ts +80 -0
- package/tui/src/tools/_shared/toolChoiceRepair/publicDataRepair.ts +92 -0
- package/tui/src/tools/_shared/toolChoiceRepair/supportRepair.ts +135 -0
- package/tui/src/tools/_shared/toolChoiceRepair.ts +55 -860
- package/tui/src/tools/shared/mockDisclaimer.ts +1 -1
- package/tui/src/tools.ts +39 -190
- package/tui/src/types/fileSuggestion.ts +4 -26
- package/tui/src/types/generated/events_mono/claude_code/v1/claude_code_internal_event.ts +186 -148
- package/tui/src/types/generated/events_mono/common/v1/auth.ts +25 -11
- package/tui/src/types/generated/events_mono/growthbook/v1/growthbook_experiment_event.ts +47 -30
- package/tui/src/types/generated/google/protobuf/timestamp.ts +21 -7
- package/tui/src/types/message.ts +80 -102
- package/tui/src/types/messageQueueTypes.ts +6 -28
- package/tui/src/types/notebook.ts +16 -38
- package/tui/src/types/statusLine.ts +4 -26
- package/tui/src/types/tools.ts +24 -46
- package/tui/src/types/utils.ts +6 -28
- package/tui/src/upstreamproxy/relay.ts +7 -3
- package/tui/src/upstreamproxy/upstreamproxy.ts +1 -1
- package/tui/src/utils/assistantMessageFactories.ts +9 -3
- package/tui/src/utils/auth.ts +129 -139
- package/tui/src/utils/bash/ast.ts +23 -23
- package/tui/src/utils/bash/bashParser.ts +5 -5
- package/tui/src/utils/billing.ts +1 -1
- package/tui/src/utils/claudeDesktop.ts +4 -4
- package/tui/src/utils/collapseReadSearch.ts +3 -3
- package/tui/src/utils/cronTasks.ts +1 -1
- package/tui/src/utils/execFileNoThrow.ts +1 -1
- package/tui/src/utils/filePersistence/types.ts +16 -38
- package/tui/src/utils/forkedAgent.ts +1 -1
- package/tui/src/utils/gracefulShutdown.ts +4 -4
- package/tui/src/utils/heapDumpService.ts +12 -8
- package/tui/src/utils/hooks/apiQueryHookHelper.ts +1 -1
- package/tui/src/utils/hooks/execPromptHook.ts +1 -1
- package/tui/src/utils/hooks/skillImprovement.ts +1 -1
- package/tui/src/utils/mcp/dateTimeParser.ts +1 -1
- package/tui/src/utils/messages.ts +18 -0
- package/tui/src/utils/migrateSessions.ts +3 -3
- package/tui/src/utils/model/model.ts +6 -6
- package/tui/src/utils/permissions/yoloClassifier.ts +1 -1
- package/tui/src/utils/plugins/headlessPluginInstall.ts +1 -1
- package/tui/src/utils/plugins/mcpPluginIntegration.ts +1 -1
- package/tui/src/utils/plugins/mcpbHandler.ts +1 -1
- package/tui/src/utils/plugins/pluginLoader.ts +8 -8
- package/tui/src/utils/protectedNamespace.ts +5 -3
- package/tui/src/utils/rawJsonToolCall.ts +242 -0
- package/tui/src/utils/ripgrep.ts +16 -7
- package/tui/src/utils/sessionTitle.ts +1 -1
- package/tui/src/utils/settings/permissionValidation.ts +14 -2
- package/tui/src/utils/shell/prefix.ts +1 -1
- package/tui/src/utils/sideQuery.ts +1 -1
- package/tui/src/utils/systemThemeWatcher.ts +13 -3
- package/tui/src/utils/teleport.tsx +1 -1
- package/uv.lock +426 -45
- package/tui/src/services/api/claude.ts +0 -3540
- package/tui/src/tools/_shared/directPublicDataGuard.ts +0 -362
- package/tui/src/tools/_shared/kmaAnalysisGuard.ts +0 -197
- package/tui/src/tools/_shared/kmaAviationGuard.ts +0 -70
- package/tui/src/tools/_shared/nmcAedGuard.ts +0 -234
- package/tui/src/tools/_shared/protectedCheckGuard.ts +0 -207
- package/tui/src/tools/_shared/textToolCallGuard.ts +0 -91
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/* eslint-disable custom-rules/no-process-env-top-level, @typescript-eslint/no-require-imports */
|
|
2
|
+
import { feature } from 'bun:bundle'
|
|
3
|
+
import type { Tool, Tools } from '../../Tool.js'
|
|
4
|
+
import { isAgentSwarmsEnabled } from '../../utils/agentSwarmsEnabled.js'
|
|
5
|
+
import { hasEmbeddedSearchTools } from '../../utils/embeddedTools.js'
|
|
6
|
+
import { isEnvTruthy } from '../../utils/envUtils.js'
|
|
7
|
+
import { isPowerShellToolEnabled } from '../../utils/shell/shellToolUtils.js'
|
|
8
|
+
import { isTodoV2Enabled } from '../../utils/tasks.js'
|
|
9
|
+
import { isWorktreeModeEnabled } from '../../utils/worktreeModeEnabled.js'
|
|
10
|
+
import { AgentTool } from '../AgentTool/AgentTool.js'
|
|
11
|
+
import { AskUserQuestionTool } from '../AskUserQuestionTool/AskUserQuestionTool.js'
|
|
12
|
+
import { BashTool } from '../BashTool/BashTool.js'
|
|
13
|
+
import { BriefTool } from '../BriefTool/BriefTool.js'
|
|
14
|
+
import { ConfigTool } from '../ConfigTool/ConfigTool.js'
|
|
15
|
+
import { EnterPlanModeTool } from '../EnterPlanModeTool/EnterPlanModeTool.js'
|
|
16
|
+
import { EnterWorktreeTool } from '../EnterWorktreeTool/EnterWorktreeTool.js'
|
|
17
|
+
import { ExitPlanModeV2Tool } from '../ExitPlanModeTool/ExitPlanModeV2Tool.js'
|
|
18
|
+
import { ExitWorktreeTool } from '../ExitWorktreeTool/ExitWorktreeTool.js'
|
|
19
|
+
import { FileEditTool } from '../FileEditTool/FileEditTool.js'
|
|
20
|
+
import { FileReadTool } from '../FileReadTool/FileReadTool.js'
|
|
21
|
+
import { FileWriteTool } from '../FileWriteTool/FileWriteTool.js'
|
|
22
|
+
import { GlobTool } from '../GlobTool/GlobTool.js'
|
|
23
|
+
import { GrepTool } from '../GrepTool/GrepTool.js'
|
|
24
|
+
import { LSPTool } from '../LSPTool/LSPTool.js'
|
|
25
|
+
import { ListMcpResourcesTool } from '../ListMcpResourcesTool/ListMcpResourcesTool.js'
|
|
26
|
+
import { NotebookEditTool } from '../NotebookEditTool/NotebookEditTool.js'
|
|
27
|
+
import { ReadMcpResourceTool } from '../ReadMcpResourceTool/ReadMcpResourceTool.js'
|
|
28
|
+
import {
|
|
29
|
+
REPL_TOOL_NAME,
|
|
30
|
+
REPL_ONLY_TOOLS,
|
|
31
|
+
isReplModeEnabled,
|
|
32
|
+
} from '../REPLTool/constants.js'
|
|
33
|
+
import { SkillTool } from '../SkillTool/SkillTool.js'
|
|
34
|
+
import { TaskCreateTool } from '../TaskCreateTool/TaskCreateTool.js'
|
|
35
|
+
import { TaskGetTool } from '../TaskGetTool/TaskGetTool.js'
|
|
36
|
+
import { TaskListTool } from '../TaskListTool/TaskListTool.js'
|
|
37
|
+
import { TaskOutputTool } from '../TaskOutputTool/TaskOutputTool.js'
|
|
38
|
+
import { TaskStopTool } from '../TaskStopTool/TaskStopTool.js'
|
|
39
|
+
import { TaskUpdateTool } from '../TaskUpdateTool/TaskUpdateTool.js'
|
|
40
|
+
import { TodoWriteTool } from '../TodoWriteTool/TodoWriteTool.js'
|
|
41
|
+
import { TungstenTool } from '../TungstenTool/TungstenTool.js'
|
|
42
|
+
import { WebFetchTool } from '../WebFetchTool/WebFetchTool.js'
|
|
43
|
+
import { WebSearchTool } from '../WebSearchTool/WebSearchTool.js'
|
|
44
|
+
import { TestingPermissionTool } from '../testing/TestingPermissionTool.js'
|
|
45
|
+
|
|
46
|
+
export { REPL_ONLY_TOOLS, REPL_TOOL_NAME, isReplModeEnabled }
|
|
47
|
+
|
|
48
|
+
const CC_SUPPORT_TOOLS_ENV = 'UMMAYA_ENABLE_CC_SUPPORT_TOOLS'
|
|
49
|
+
|
|
50
|
+
const REPLTool =
|
|
51
|
+
process.env.USER_TYPE === 'ant'
|
|
52
|
+
? require('../REPLTool/REPLTool.js').REPLTool
|
|
53
|
+
: null
|
|
54
|
+
const SuggestBackgroundPRTool =
|
|
55
|
+
process.env.USER_TYPE === 'ant'
|
|
56
|
+
? require('../SuggestBackgroundPRTool/SuggestBackgroundPRTool.js')
|
|
57
|
+
.SuggestBackgroundPRTool
|
|
58
|
+
: null
|
|
59
|
+
const SleepTool =
|
|
60
|
+
feature('PROACTIVE') || feature('KAIROS')
|
|
61
|
+
? require('../SleepTool/SleepTool.js').SleepTool
|
|
62
|
+
: null
|
|
63
|
+
const cronTools = feature('AGENT_TRIGGERS')
|
|
64
|
+
? [
|
|
65
|
+
require('../ScheduleCronTool/CronCreateTool.js').CronCreateTool,
|
|
66
|
+
require('../ScheduleCronTool/CronDeleteTool.js').CronDeleteTool,
|
|
67
|
+
require('../ScheduleCronTool/CronListTool.js').CronListTool,
|
|
68
|
+
]
|
|
69
|
+
: []
|
|
70
|
+
const RemoteTriggerTool = feature('AGENT_TRIGGERS_REMOTE')
|
|
71
|
+
? require('../RemoteTriggerTool/RemoteTriggerTool.js').RemoteTriggerTool
|
|
72
|
+
: null
|
|
73
|
+
const MonitorTool = feature('MONITOR_TOOL')
|
|
74
|
+
? require('../MonitorTool/MonitorTool.js').MonitorTool
|
|
75
|
+
: null
|
|
76
|
+
const SendUserFileTool = feature('KAIROS')
|
|
77
|
+
? require('../SendUserFileTool/SendUserFileTool.js').SendUserFileTool
|
|
78
|
+
: null
|
|
79
|
+
const PushNotificationTool =
|
|
80
|
+
feature('KAIROS') || feature('KAIROS_PUSH_NOTIFICATION')
|
|
81
|
+
? require('../PushNotificationTool/PushNotificationTool.js')
|
|
82
|
+
.PushNotificationTool
|
|
83
|
+
: null
|
|
84
|
+
const SubscribePRTool = feature('KAIROS_GITHUB_WEBHOOKS')
|
|
85
|
+
? require('../SubscribePRTool/SubscribePRTool.js').SubscribePRTool
|
|
86
|
+
: null
|
|
87
|
+
const OverflowTestTool = feature('OVERFLOW_TEST_TOOL')
|
|
88
|
+
? require('../OverflowTestTool/OverflowTestTool.js').OverflowTestTool
|
|
89
|
+
: null
|
|
90
|
+
const CtxInspectTool = feature('CONTEXT_COLLAPSE')
|
|
91
|
+
? require('../CtxInspectTool/CtxInspectTool.js').CtxInspectTool
|
|
92
|
+
: null
|
|
93
|
+
const TerminalCaptureTool = feature('TERMINAL_PANEL')
|
|
94
|
+
? require('../TerminalCaptureTool/TerminalCaptureTool.js').TerminalCaptureTool
|
|
95
|
+
: null
|
|
96
|
+
const WebBrowserTool = feature('WEB_BROWSER_TOOL')
|
|
97
|
+
? require('../WebBrowserTool/WebBrowserTool.js').WebBrowserTool
|
|
98
|
+
: null
|
|
99
|
+
const coordinatorModeModule = feature('COORDINATOR_MODE')
|
|
100
|
+
? require('../../coordinator/coordinatorMode.js')
|
|
101
|
+
: null
|
|
102
|
+
const SnipTool = feature('HISTORY_SNIP')
|
|
103
|
+
? require('../SnipTool/SnipTool.js').SnipTool
|
|
104
|
+
: null
|
|
105
|
+
const ListPeersTool = feature('UDS_INBOX')
|
|
106
|
+
? require('../ListPeersTool/ListPeersTool.js').ListPeersTool
|
|
107
|
+
: null
|
|
108
|
+
const WorkflowTool = feature('WORKFLOW_SCRIPTS')
|
|
109
|
+
? (() => {
|
|
110
|
+
require('../WorkflowTool/bundled/index.js').initBundledWorkflows()
|
|
111
|
+
return require('../WorkflowTool/WorkflowTool.js').WorkflowTool
|
|
112
|
+
})()
|
|
113
|
+
: null
|
|
114
|
+
const VerifyPlanExecutionTool =
|
|
115
|
+
process.env.CLAUDE_CODE_VERIFY_PLAN === 'true'
|
|
116
|
+
? require('../VerifyPlanExecutionTool/VerifyPlanExecutionTool.js')
|
|
117
|
+
.VerifyPlanExecutionTool
|
|
118
|
+
: null
|
|
119
|
+
|
|
120
|
+
function getTeamCreateTool() {
|
|
121
|
+
return require('../TeamCreateTool/TeamCreateTool.js').TeamCreateTool
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function getTeamDeleteTool() {
|
|
125
|
+
return require('../TeamDeleteTool/TeamDeleteTool.js').TeamDeleteTool
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function getSendMessageTool() {
|
|
129
|
+
return require('../SendMessageTool/SendMessageTool.js').SendMessageTool
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function getPowerShellTool() {
|
|
133
|
+
if (!isPowerShellToolEnabled()) return null
|
|
134
|
+
return require('../PowerShellTool/PowerShellTool.js').PowerShellTool
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function asDeferredCcSupportTool(tool: Tool): Tool {
|
|
138
|
+
if (tool.alwaysLoad === true || tool.shouldDefer === true) return tool
|
|
139
|
+
return { ...tool, shouldDefer: true }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function areCcSupportToolsEnabled(): boolean {
|
|
143
|
+
return process.env[CC_SUPPORT_TOOLS_ENV] !== '0'
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export function getSupportSimpleModeTools(modelFacingTools: Tools): Tools {
|
|
147
|
+
if (isReplModeEnabled() && REPLTool && areCcSupportToolsEnabled()) {
|
|
148
|
+
const replSimple: Tool[] = [REPLTool]
|
|
149
|
+
if (
|
|
150
|
+
feature('COORDINATOR_MODE') &&
|
|
151
|
+
coordinatorModeModule?.isCoordinatorMode()
|
|
152
|
+
) {
|
|
153
|
+
replSimple.push(TaskStopTool, getSendMessageTool())
|
|
154
|
+
}
|
|
155
|
+
return replSimple
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
const simpleTools: Tool[] = [...modelFacingTools]
|
|
159
|
+
if (
|
|
160
|
+
feature('COORDINATOR_MODE') &&
|
|
161
|
+
coordinatorModeModule?.isCoordinatorMode() &&
|
|
162
|
+
areCcSupportToolsEnabled()
|
|
163
|
+
) {
|
|
164
|
+
simpleTools.push(AgentTool, TaskStopTool, getSendMessageTool())
|
|
165
|
+
}
|
|
166
|
+
return simpleTools
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function getCcSupportCapabilityTools(): Tools {
|
|
170
|
+
if (!areCcSupportToolsEnabled()) return []
|
|
171
|
+
const powerShellTool = getPowerShellTool()
|
|
172
|
+
return [
|
|
173
|
+
AgentTool,
|
|
174
|
+
TaskOutputTool,
|
|
175
|
+
BashTool,
|
|
176
|
+
...(hasEmbeddedSearchTools() ? [] : [GlobTool, GrepTool]),
|
|
177
|
+
ExitPlanModeV2Tool,
|
|
178
|
+
FileReadTool,
|
|
179
|
+
FileEditTool,
|
|
180
|
+
FileWriteTool,
|
|
181
|
+
NotebookEditTool,
|
|
182
|
+
WebFetchTool,
|
|
183
|
+
TodoWriteTool,
|
|
184
|
+
WebSearchTool,
|
|
185
|
+
TaskStopTool,
|
|
186
|
+
AskUserQuestionTool,
|
|
187
|
+
SkillTool,
|
|
188
|
+
EnterPlanModeTool,
|
|
189
|
+
...(process.env.USER_TYPE === 'ant' ? [ConfigTool, TungstenTool] : []),
|
|
190
|
+
...(SuggestBackgroundPRTool ? [SuggestBackgroundPRTool] : []),
|
|
191
|
+
...(WebBrowserTool ? [WebBrowserTool] : []),
|
|
192
|
+
...(isTodoV2Enabled()
|
|
193
|
+
? [TaskCreateTool, TaskGetTool, TaskUpdateTool, TaskListTool]
|
|
194
|
+
: []),
|
|
195
|
+
...(OverflowTestTool ? [OverflowTestTool] : []),
|
|
196
|
+
...(CtxInspectTool ? [CtxInspectTool] : []),
|
|
197
|
+
...(TerminalCaptureTool ? [TerminalCaptureTool] : []),
|
|
198
|
+
...(isEnvTruthy(process.env.ENABLE_LSP_TOOL) ? [LSPTool] : []),
|
|
199
|
+
...(isWorktreeModeEnabled() ? [EnterWorktreeTool, ExitWorktreeTool] : []),
|
|
200
|
+
getSendMessageTool(),
|
|
201
|
+
...(ListPeersTool ? [ListPeersTool] : []),
|
|
202
|
+
...(isAgentSwarmsEnabled()
|
|
203
|
+
? [getTeamCreateTool(), getTeamDeleteTool()]
|
|
204
|
+
: []),
|
|
205
|
+
...(VerifyPlanExecutionTool ? [VerifyPlanExecutionTool] : []),
|
|
206
|
+
...(process.env.USER_TYPE === 'ant' && REPLTool ? [REPLTool] : []),
|
|
207
|
+
...(WorkflowTool ? [WorkflowTool] : []),
|
|
208
|
+
...(SleepTool ? [SleepTool] : []),
|
|
209
|
+
...cronTools,
|
|
210
|
+
...(RemoteTriggerTool ? [RemoteTriggerTool] : []),
|
|
211
|
+
...(MonitorTool ? [MonitorTool] : []),
|
|
212
|
+
BriefTool,
|
|
213
|
+
...(SendUserFileTool ? [SendUserFileTool] : []),
|
|
214
|
+
...(PushNotificationTool ? [PushNotificationTool] : []),
|
|
215
|
+
...(SubscribePRTool ? [SubscribePRTool] : []),
|
|
216
|
+
...(powerShellTool ? [powerShellTool] : []),
|
|
217
|
+
...(SnipTool ? [SnipTool] : []),
|
|
218
|
+
...(process.env.NODE_ENV === 'test' ? [TestingPermissionTool] : []),
|
|
219
|
+
ListMcpResourcesTool,
|
|
220
|
+
ReadMcpResourceTool,
|
|
221
|
+
].map(asDeferredCcSupportTool)
|
|
222
|
+
}
|
|
223
|
+
/* eslint-enable custom-rules/no-process-env-top-level, @typescript-eslint/no-require-imports */
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import memoize from 'lodash-es/memoize.js'
|
|
2
|
+
import { findToolByName, type Tools } from '../../Tool.js'
|
|
3
|
+
import { logForDebugging } from '../../utils/debug.js'
|
|
4
|
+
|
|
5
|
+
let cachedDeferredToolNames: string | null = null
|
|
6
|
+
|
|
7
|
+
function getDeferredToolsCacheKey(deferredTools: Tools): string {
|
|
8
|
+
return deferredTools
|
|
9
|
+
.map(tool => tool.name)
|
|
10
|
+
.sort()
|
|
11
|
+
.join(',')
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const getToolDescriptionMemoized = memoize(
|
|
15
|
+
async (toolName: string, tools: Tools): Promise<string> => {
|
|
16
|
+
const tool = findToolByName(tools, toolName)
|
|
17
|
+
if (!tool) {
|
|
18
|
+
return ''
|
|
19
|
+
}
|
|
20
|
+
return tool.prompt({
|
|
21
|
+
getToolPermissionContext: async () => ({
|
|
22
|
+
mode: 'default' as const,
|
|
23
|
+
additionalWorkingDirectories: new Map(),
|
|
24
|
+
alwaysAllowRules: {},
|
|
25
|
+
alwaysDenyRules: {},
|
|
26
|
+
alwaysAskRules: {},
|
|
27
|
+
isBypassPermissionsModeAvailable: false,
|
|
28
|
+
}),
|
|
29
|
+
tools,
|
|
30
|
+
agents: [],
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
(toolName: string) => toolName,
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
export function maybeInvalidateCache(deferredTools: Tools): void {
|
|
37
|
+
const currentKey = getDeferredToolsCacheKey(deferredTools)
|
|
38
|
+
if (cachedDeferredToolNames !== currentKey) {
|
|
39
|
+
logForDebugging(
|
|
40
|
+
`ToolSearchTool: cache invalidated - deferred tools changed`,
|
|
41
|
+
)
|
|
42
|
+
getToolDescriptionMemoized.cache.clear?.()
|
|
43
|
+
cachedDeferredToolNames = currentKey
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function clearToolSearchDescriptionCache(): void {
|
|
48
|
+
getToolDescriptionMemoized.cache.clear?.()
|
|
49
|
+
cachedDeferredToolNames = null
|
|
50
|
+
}
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { findToolByName, type Tool, type Tools } from '../../Tool.js'
|
|
2
|
+
import { escapeRegExp } from '../../utils/stringUtils.js'
|
|
3
|
+
import { getToolDescriptionMemoized } from './descriptionCache.js'
|
|
4
|
+
import {
|
|
5
|
+
expandedIntentTermSet,
|
|
6
|
+
expandedToolSearchTerms,
|
|
7
|
+
} from './supportIntentHints.js'
|
|
8
|
+
|
|
9
|
+
type ParsedToolName = {
|
|
10
|
+
readonly parts: readonly string[]
|
|
11
|
+
readonly full: string
|
|
12
|
+
readonly isMcp: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type ScoredTool = {
|
|
16
|
+
readonly name: string
|
|
17
|
+
readonly score: number
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function parseToolName(name: string): ParsedToolName {
|
|
21
|
+
if (name.startsWith('mcp__')) {
|
|
22
|
+
const withoutPrefix = name.replace(/^mcp__/, '').toLowerCase()
|
|
23
|
+
const parts = withoutPrefix.split('__').flatMap(part => part.split('_'))
|
|
24
|
+
return {
|
|
25
|
+
parts: parts.filter(Boolean),
|
|
26
|
+
full: withoutPrefix.replace(/__/g, ' ').replace(/_/g, ' '),
|
|
27
|
+
isMcp: true,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const parts = name
|
|
32
|
+
.replace(/([a-z])([A-Z])/g, '$1 $2')
|
|
33
|
+
.replace(/_/g, ' ')
|
|
34
|
+
.toLowerCase()
|
|
35
|
+
.split(/\s+/)
|
|
36
|
+
.filter(Boolean)
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
parts,
|
|
40
|
+
full: parts.join(' '),
|
|
41
|
+
isMcp: false,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function compileTermPatterns(terms: readonly string[]): Map<string, RegExp> {
|
|
46
|
+
const patterns = new Map<string, RegExp>()
|
|
47
|
+
for (const term of terms) {
|
|
48
|
+
if (!patterns.has(term)) {
|
|
49
|
+
patterns.set(term, new RegExp(`\\b${escapeRegExp(term)}\\b`))
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return patterns
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getTermPattern(
|
|
56
|
+
patterns: ReadonlyMap<string, RegExp>,
|
|
57
|
+
term: string,
|
|
58
|
+
): RegExp {
|
|
59
|
+
return patterns.get(term) ?? new RegExp(`\\b${escapeRegExp(term)}\\b`)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function splitQueryTerms(queryLower: string): {
|
|
63
|
+
readonly requiredTerms: readonly string[]
|
|
64
|
+
readonly optionalTerms: readonly string[]
|
|
65
|
+
readonly queryTerms: readonly string[]
|
|
66
|
+
} {
|
|
67
|
+
const queryTerms = expandedToolSearchTerms(queryLower)
|
|
68
|
+
const requiredTerms: string[] = []
|
|
69
|
+
const optionalTerms: string[] = []
|
|
70
|
+
for (const term of queryTerms) {
|
|
71
|
+
if (term.startsWith('+') && term.length > 1) {
|
|
72
|
+
requiredTerms.push(term.slice(1))
|
|
73
|
+
} else {
|
|
74
|
+
optionalTerms.push(term)
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return { requiredTerms, optionalTerms, queryTerms }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function requiredTermMatches({
|
|
81
|
+
parsed,
|
|
82
|
+
descNormalized,
|
|
83
|
+
hintNormalized,
|
|
84
|
+
expandedTerms,
|
|
85
|
+
termPatterns,
|
|
86
|
+
term,
|
|
87
|
+
}: {
|
|
88
|
+
readonly parsed: ParsedToolName
|
|
89
|
+
readonly descNormalized: string
|
|
90
|
+
readonly hintNormalized: string
|
|
91
|
+
readonly expandedTerms: ReadonlySet<string>
|
|
92
|
+
readonly termPatterns: ReadonlyMap<string, RegExp>
|
|
93
|
+
readonly term: string
|
|
94
|
+
}): boolean {
|
|
95
|
+
const pattern = getTermPattern(termPatterns, term)
|
|
96
|
+
const canUsePromptBody = !expandedTerms.has(term)
|
|
97
|
+
return (
|
|
98
|
+
parsed.parts.includes(term) ||
|
|
99
|
+
parsed.parts.some(part => part.includes(term)) ||
|
|
100
|
+
(canUsePromptBody && pattern.test(descNormalized)) ||
|
|
101
|
+
(hintNormalized.length > 0 && pattern.test(hintNormalized))
|
|
102
|
+
)
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
async function filterRequiredTermMatches(
|
|
106
|
+
deferredTools: Tools,
|
|
107
|
+
tools: Tools,
|
|
108
|
+
requiredTerms: readonly string[],
|
|
109
|
+
expandedTerms: ReadonlySet<string>,
|
|
110
|
+
termPatterns: ReadonlyMap<string, RegExp>,
|
|
111
|
+
): Promise<Tools> {
|
|
112
|
+
if (requiredTerms.length === 0) return deferredTools
|
|
113
|
+
const matches = await Promise.all(
|
|
114
|
+
deferredTools.map(async tool => {
|
|
115
|
+
const parsed = parseToolName(tool.name)
|
|
116
|
+
const description = await getToolDescriptionMemoized(tool.name, tools)
|
|
117
|
+
const descNormalized = description.toLowerCase()
|
|
118
|
+
const hintNormalized = tool.searchHint?.toLowerCase() ?? ''
|
|
119
|
+
const matchesAll = requiredTerms.every(term =>
|
|
120
|
+
requiredTermMatches({
|
|
121
|
+
parsed,
|
|
122
|
+
descNormalized,
|
|
123
|
+
hintNormalized,
|
|
124
|
+
expandedTerms,
|
|
125
|
+
termPatterns,
|
|
126
|
+
term,
|
|
127
|
+
}),
|
|
128
|
+
)
|
|
129
|
+
return matchesAll ? tool : null
|
|
130
|
+
}),
|
|
131
|
+
)
|
|
132
|
+
return matches.filter((tool): tool is Tool => tool !== null)
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async function scoreTool(
|
|
136
|
+
tool: Tool,
|
|
137
|
+
tools: Tools,
|
|
138
|
+
allScoringTerms: readonly string[],
|
|
139
|
+
expandedTerms: ReadonlySet<string>,
|
|
140
|
+
termPatterns: ReadonlyMap<string, RegExp>,
|
|
141
|
+
): Promise<ScoredTool> {
|
|
142
|
+
const parsed = parseToolName(tool.name)
|
|
143
|
+
const description = await getToolDescriptionMemoized(tool.name, tools)
|
|
144
|
+
const descNormalized = description.toLowerCase()
|
|
145
|
+
const hintNormalized = tool.searchHint?.toLowerCase() ?? ''
|
|
146
|
+
let score = 0
|
|
147
|
+
|
|
148
|
+
for (const term of allScoringTerms) {
|
|
149
|
+
const pattern = getTermPattern(termPatterns, term)
|
|
150
|
+
if (parsed.parts.includes(term)) {
|
|
151
|
+
score += parsed.isMcp ? 12 : 10
|
|
152
|
+
} else if (parsed.parts.some(part => part.includes(term))) {
|
|
153
|
+
score += parsed.isMcp ? 6 : 5
|
|
154
|
+
}
|
|
155
|
+
if (parsed.full.includes(term) && score === 0) {
|
|
156
|
+
score += 3
|
|
157
|
+
}
|
|
158
|
+
if (hintNormalized.length > 0 && pattern.test(hintNormalized)) {
|
|
159
|
+
score += 4
|
|
160
|
+
}
|
|
161
|
+
if (!expandedTerms.has(term) && pattern.test(descNormalized)) {
|
|
162
|
+
score += 2
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
return { name: tool.name, score }
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export async function searchToolsWithKeywords(
|
|
170
|
+
query: string,
|
|
171
|
+
deferredTools: Tools,
|
|
172
|
+
tools: Tools,
|
|
173
|
+
maxResults: number,
|
|
174
|
+
): Promise<string[]> {
|
|
175
|
+
const queryLower = query.toLowerCase().trim()
|
|
176
|
+
const exactMatch =
|
|
177
|
+
deferredTools.find(tool => tool.name.toLowerCase() === queryLower) ??
|
|
178
|
+
findToolByName(tools, queryLower)
|
|
179
|
+
if (exactMatch) {
|
|
180
|
+
return [exactMatch.name]
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
if (queryLower.startsWith('mcp__') && queryLower.length > 5) {
|
|
184
|
+
const prefixMatches = deferredTools
|
|
185
|
+
.filter(tool => tool.name.toLowerCase().startsWith(queryLower))
|
|
186
|
+
.slice(0, maxResults)
|
|
187
|
+
.map(tool => tool.name)
|
|
188
|
+
if (prefixMatches.length > 0) {
|
|
189
|
+
return prefixMatches
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const { requiredTerms, optionalTerms, queryTerms } = splitQueryTerms(queryLower)
|
|
194
|
+
const allScoringTerms =
|
|
195
|
+
requiredTerms.length > 0 ? [...requiredTerms, ...optionalTerms] : queryTerms
|
|
196
|
+
const expandedTerms = expandedIntentTermSet(queryLower)
|
|
197
|
+
const termPatterns = compileTermPatterns(allScoringTerms)
|
|
198
|
+
const candidateTools = await filterRequiredTermMatches(
|
|
199
|
+
deferredTools,
|
|
200
|
+
tools,
|
|
201
|
+
requiredTerms,
|
|
202
|
+
expandedTerms,
|
|
203
|
+
termPatterns,
|
|
204
|
+
)
|
|
205
|
+
const scored = await Promise.all(
|
|
206
|
+
candidateTools.map(tool =>
|
|
207
|
+
scoreTool(tool, tools, allScoringTerms, expandedTerms, termPatterns),
|
|
208
|
+
),
|
|
209
|
+
)
|
|
210
|
+
|
|
211
|
+
return scored
|
|
212
|
+
.filter(item => item.score > 0)
|
|
213
|
+
.sort((left, right) => right.score - left.score)
|
|
214
|
+
.slice(0, maxResults)
|
|
215
|
+
.map(item => item.name)
|
|
216
|
+
}
|
|
@@ -3,6 +3,7 @@ import { isReplBridgeActive } from '../../bootstrap/state.js'
|
|
|
3
3
|
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../../services/analytics/growthbook.js'
|
|
4
4
|
import type { Tool } from '../../Tool.js'
|
|
5
5
|
import { AGENT_TOOL_NAME } from '../AgentTool/constants.js'
|
|
6
|
+
import { formatDeferredToolSearchLine } from './supportIntentHints.js'
|
|
6
7
|
|
|
7
8
|
// Dead code elimination: Brief tool name only needed when KAIROS or KAIROS_BRIEF is on
|
|
8
9
|
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
@@ -48,7 +49,13 @@ Result format: each matched tool appears as one <function>{"description": "...",
|
|
|
48
49
|
Query forms:
|
|
49
50
|
- "select:Read,Edit,Grep" — fetch these exact tools by name
|
|
50
51
|
- "notebook jupyter" — keyword search, up to max_results best matches
|
|
51
|
-
- "+slack send" — require "slack" in the name, rank by remaining terms
|
|
52
|
+
- "+slack send" — require "slack" in the name, rank by remaining terms
|
|
53
|
+
|
|
54
|
+
Support-tool query examples:
|
|
55
|
+
- "source verification web search" — fetch WebSearch/WebFetch for current evidence and URL source checks
|
|
56
|
+
- "MCP resources" — fetch ListMcpResourcesTool/ReadMcpResourceTool for trusted MCP resource boundaries
|
|
57
|
+
- "Agent progress cancel" — fetch Agent or task tools for delegated research with visible progress/cancel state
|
|
58
|
+
- "workspace write permission" or "shell permission" — fetch workspace write/shell tools when a visible permission or blocked boundary is required`
|
|
52
59
|
|
|
53
60
|
/**
|
|
54
61
|
* Check if a tool should be deferred (requires ToolSearch to load).
|
|
@@ -109,11 +116,10 @@ export function isDeferredTool(tool: Tool): boolean {
|
|
|
109
116
|
|
|
110
117
|
/**
|
|
111
118
|
* Format one deferred-tool line for the <available-deferred-tools> user
|
|
112
|
-
* message. Search hints
|
|
113
|
-
* hints A/B (exp_xenhnnmn0smrx4, stopped Mar 21) showed no benefit.
|
|
119
|
+
* message. Search hints stay text-only so the block cannot inject markup.
|
|
114
120
|
*/
|
|
115
121
|
export function formatDeferredToolLine(tool: Tool): string {
|
|
116
|
-
return tool
|
|
122
|
+
return formatDeferredToolSearchLine(tool)
|
|
117
123
|
}
|
|
118
124
|
|
|
119
125
|
export function getPrompt(): string {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ToolResultBlockParam } from '@anthropic-ai/sdk/resources/index.mjs'
|
|
2
|
+
import type { Output } from './schemas.js'
|
|
3
|
+
|
|
4
|
+
export function buildSearchResult(
|
|
5
|
+
matches: string[],
|
|
6
|
+
query: string,
|
|
7
|
+
totalDeferredTools: number,
|
|
8
|
+
pendingMcpServers?: string[],
|
|
9
|
+
): { data: Output } {
|
|
10
|
+
return {
|
|
11
|
+
data: {
|
|
12
|
+
matches,
|
|
13
|
+
query,
|
|
14
|
+
total_deferred_tools: totalDeferredTools,
|
|
15
|
+
...(pendingMcpServers && pendingMcpServers.length > 0
|
|
16
|
+
? { pending_mcp_servers: pendingMcpServers }
|
|
17
|
+
: {}),
|
|
18
|
+
},
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function makeToolReferenceContent(
|
|
23
|
+
matches: readonly string[],
|
|
24
|
+
): ToolResultBlockParam['content'] {
|
|
25
|
+
const content = matches.map(name => ({
|
|
26
|
+
type: 'tool_reference',
|
|
27
|
+
tool_name: name,
|
|
28
|
+
}))
|
|
29
|
+
return JSON.parse(JSON.stringify(content))
|
|
30
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod/v4'
|
|
2
|
+
import { lazySchema } from '../../utils/lazySchema.js'
|
|
3
|
+
|
|
4
|
+
export const inputSchema = lazySchema(() =>
|
|
5
|
+
z.object({
|
|
6
|
+
query: z
|
|
7
|
+
.string()
|
|
8
|
+
.describe(
|
|
9
|
+
'Query to find deferred tools. Use "select:<tool_name>" for direct selection, or keywords to search.',
|
|
10
|
+
),
|
|
11
|
+
max_results: z
|
|
12
|
+
.number()
|
|
13
|
+
.optional()
|
|
14
|
+
.default(5)
|
|
15
|
+
.describe('Maximum number of results to return (default: 5)'),
|
|
16
|
+
}),
|
|
17
|
+
)
|
|
18
|
+
export type InputSchema = ReturnType<typeof inputSchema>
|
|
19
|
+
|
|
20
|
+
export const outputSchema = lazySchema(() =>
|
|
21
|
+
z.object({
|
|
22
|
+
matches: z.array(z.string()),
|
|
23
|
+
query: z.string(),
|
|
24
|
+
total_deferred_tools: z.number(),
|
|
25
|
+
pending_mcp_servers: z.array(z.string()).optional(),
|
|
26
|
+
}),
|
|
27
|
+
)
|
|
28
|
+
export type OutputSchema = ReturnType<typeof outputSchema>
|
|
29
|
+
|
|
30
|
+
export type Output = z.infer<OutputSchema>
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ToolPermissionContext, Tools } from '../../Tool.js'
|
|
2
|
+
import { isDeferredTool } from './prompt.js'
|
|
3
|
+
import { selectRecoveredSupportToolNamesForQuery } from './supportIntentHints.js'
|
|
4
|
+
|
|
5
|
+
const DEFAULT_DISCOVERABLE_SUPPORT_TOOLS = new Set(['WebSearch', 'WebFetch'])
|
|
6
|
+
|
|
7
|
+
function selectedSupportToolNames(query: string): ReadonlySet<string> {
|
|
8
|
+
const names = new Set(DEFAULT_DISCOVERABLE_SUPPORT_TOOLS)
|
|
9
|
+
for (const toolName of selectRecoveredSupportToolNamesForQuery(query)) {
|
|
10
|
+
names.add(toolName)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const selectMatch = query.match(/^select:(.+)$/iu)
|
|
14
|
+
if (selectMatch) {
|
|
15
|
+
for (const toolName of (selectMatch[1] ?? '').split(',')) {
|
|
16
|
+
const trimmed = toolName.trim()
|
|
17
|
+
if (trimmed.length > 0) names.add(trimmed)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return names
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export async function getToolSearchPool(
|
|
24
|
+
tools: Tools,
|
|
25
|
+
getAppState: () => { toolPermissionContext?: ToolPermissionContext },
|
|
26
|
+
query = '',
|
|
27
|
+
): Promise<Tools> {
|
|
28
|
+
const byName = new Map(tools.map(tool => [tool.name, tool]))
|
|
29
|
+
const { filterToolsByDenyRules, getAllBaseTools } = await import(
|
|
30
|
+
'../../tools.js'
|
|
31
|
+
)
|
|
32
|
+
const appState = getAppState()
|
|
33
|
+
const registeredDeferredTools = getAllBaseTools().filter(isDeferredTool)
|
|
34
|
+
const policyFilteredTools = appState.toolPermissionContext
|
|
35
|
+
? filterToolsByDenyRules(
|
|
36
|
+
registeredDeferredTools,
|
|
37
|
+
appState.toolPermissionContext,
|
|
38
|
+
)
|
|
39
|
+
: registeredDeferredTools
|
|
40
|
+
const supportToolNames = selectedSupportToolNames(query)
|
|
41
|
+
|
|
42
|
+
for (const tool of policyFilteredTools) {
|
|
43
|
+
if (!byName.has(tool.name) && !supportToolNames.has(tool.name)) continue
|
|
44
|
+
if (!byName.has(tool.name)) byName.set(tool.name, tool)
|
|
45
|
+
}
|
|
46
|
+
return [...byName.values()]
|
|
47
|
+
}
|