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
|
@@ -15,7 +15,7 @@ export async function getClaudeDesktopConfigPath(): Promise<string> {
|
|
|
15
15
|
|
|
16
16
|
if (!SUPPORTED_PLATFORMS.includes(platform)) {
|
|
17
17
|
throw new Error(
|
|
18
|
-
`Unsupported platform: ${platform} -
|
|
18
|
+
`Unsupported platform: ${platform} - desktop MCP config import only works on macOS and WSL.`,
|
|
19
19
|
)
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -56,7 +56,7 @@ export async function getClaudeDesktopConfigPath(): Promise<string> {
|
|
|
56
56
|
try {
|
|
57
57
|
const userDirs = await readdir(usersDir, { withFileTypes: true })
|
|
58
58
|
|
|
59
|
-
// Look for
|
|
59
|
+
// Look for the desktop MCP config in each user directory
|
|
60
60
|
for (const user of userDirs) {
|
|
61
61
|
if (
|
|
62
62
|
user.name === 'Public' ||
|
|
@@ -91,7 +91,7 @@ export async function getClaudeDesktopConfigPath(): Promise<string> {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
throw new Error(
|
|
94
|
-
'Could not find
|
|
94
|
+
'Could not find a desktop MCP config file in Windows.',
|
|
95
95
|
)
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -100,7 +100,7 @@ export async function readClaudeDesktopMcpServers(): Promise<
|
|
|
100
100
|
> {
|
|
101
101
|
if (!SUPPORTED_PLATFORMS.includes(getPlatform())) {
|
|
102
102
|
throw new Error(
|
|
103
|
-
'Unsupported platform -
|
|
103
|
+
'Unsupported platform - desktop MCP config import only works on macOS and WSL.',
|
|
104
104
|
)
|
|
105
105
|
}
|
|
106
106
|
try {
|
|
@@ -54,7 +54,7 @@ export type SearchOrReadResult = {
|
|
|
54
54
|
isMemoryWrite: boolean
|
|
55
55
|
/**
|
|
56
56
|
* True for meta-operations that should be absorbed into a collapse group
|
|
57
|
-
* without incrementing
|
|
57
|
+
* without incrementing the count (Snip, ToolSearch). They remain visible
|
|
58
58
|
* in verbose mode via the groupMessages iteration.
|
|
59
59
|
*/
|
|
60
60
|
isAbsorbedSilently: boolean
|
|
@@ -212,7 +212,7 @@ export function getToolSearchOrReadInfo(
|
|
|
212
212
|
}
|
|
213
213
|
// The tool's isSearchOrReadCommand method handles its own input validation via safeParse,
|
|
214
214
|
// so passing the raw input is safe. The type assertion is necessary because Tool[] uses
|
|
215
|
-
// the default generic
|
|
215
|
+
// the default generic expects a loose record, but we receive unknown at runtime.
|
|
216
216
|
const result = tool.isSearchOrReadCommand(
|
|
217
217
|
toolInput as { [x: string]: unknown },
|
|
218
218
|
)
|
|
@@ -481,7 +481,7 @@ export function getToolUseIdsFromCollapsedGroup(
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
/**
|
|
484
|
-
* Check if
|
|
484
|
+
* Check if a tool in a collapsed group is in progress.
|
|
485
485
|
*/
|
|
486
486
|
export function hasAnyToolInProgress(
|
|
487
487
|
message: CollapsedReadSearchGroup,
|
|
@@ -140,7 +140,7 @@ export async function readCronTasks(dir?: string): Promise<CronTask[]> {
|
|
|
140
140
|
}
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
|
-
* Sync check for whether the cron file
|
|
143
|
+
* Sync check for whether the cron file includes valid tasks. Used by
|
|
144
144
|
* cronScheduler.start() to decide whether to auto-enable. One file read.
|
|
145
145
|
*/
|
|
146
146
|
export function hasCronTasksSync(dir?: string): boolean {
|
|
@@ -109,7 +109,7 @@ export function execFileNoThrowWithCwd(
|
|
|
109
109
|
// Use execa for cross-platform .bat/.cmd compatibility on Windows
|
|
110
110
|
execa(file, args, {
|
|
111
111
|
maxBuffer,
|
|
112
|
-
|
|
112
|
+
cancelSignal: abortSignal,
|
|
113
113
|
timeout: finalTimeout,
|
|
114
114
|
cwd: finalCwd,
|
|
115
115
|
env: finalEnv,
|
|
@@ -1,44 +1,22 @@
|
|
|
1
1
|
// [P0 reconstructed · rebuild-stubs.ts · symbol-complete stub]
|
|
2
2
|
// Aggregated from every consumer import across src/.
|
|
3
|
-
|
|
3
|
+
import { createStub } from '../../stubs/any-stub'
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
const __stub: any = new Proxy(function () {} as any, {
|
|
7
|
-
get(_t, p) {
|
|
8
|
-
if (p === Symbol.toPrimitive) return () => ""
|
|
9
|
-
if (p === Symbol.iterator) return function* () {}
|
|
10
|
-
if (p === Symbol.asyncIterator) return async function* () {}
|
|
11
|
-
if (p === Symbol.toStringTag) return "Stub"
|
|
12
|
-
if (p === Symbol.for("nodejs.util.inspect.custom")) return () => "<Stub>"
|
|
13
|
-
if (p === "inspect") return () => "<Stub>"
|
|
14
|
-
if (p === "then") return undefined
|
|
15
|
-
if (p === "toString") return () => ""
|
|
16
|
-
if (p === "valueOf") return () => undefined
|
|
17
|
-
if (p === "toJSON") return () => null
|
|
18
|
-
if (p === "length") return 0
|
|
19
|
-
if (p === "name") return "Stub"
|
|
20
|
-
if (p === "message") return ""
|
|
21
|
-
if (p === "stack") return ""
|
|
22
|
-
if (p === "constructor") return Object
|
|
23
|
-
return __stub
|
|
24
|
-
},
|
|
25
|
-
apply() { return __stub },
|
|
26
|
-
construct() { return __stub },
|
|
27
|
-
});
|
|
5
|
+
const __stub = createStub()
|
|
28
6
|
|
|
29
|
-
export type DEFAULT_UPLOAD_CONCURRENCY =
|
|
30
|
-
export const DEFAULT_UPLOAD_CONCURRENCY
|
|
31
|
-
export type FILE_COUNT_LIMIT =
|
|
32
|
-
export const FILE_COUNT_LIMIT
|
|
33
|
-
export type FailedPersistence =
|
|
34
|
-
export const FailedPersistence
|
|
35
|
-
export type FilesPersistedEventData =
|
|
36
|
-
export const FilesPersistedEventData
|
|
37
|
-
export type OUTPUTS_SUBDIR =
|
|
38
|
-
export const OUTPUTS_SUBDIR
|
|
39
|
-
export type PersistedFile =
|
|
40
|
-
export const PersistedFile
|
|
41
|
-
export type TurnStartTime =
|
|
42
|
-
export const TurnStartTime
|
|
7
|
+
export type DEFAULT_UPLOAD_CONCURRENCY = unknown;
|
|
8
|
+
export const DEFAULT_UPLOAD_CONCURRENCY = __stub;
|
|
9
|
+
export type FILE_COUNT_LIMIT = unknown;
|
|
10
|
+
export const FILE_COUNT_LIMIT = __stub;
|
|
11
|
+
export type FailedPersistence = unknown;
|
|
12
|
+
export const FailedPersistence = __stub;
|
|
13
|
+
export type FilesPersistedEventData = unknown;
|
|
14
|
+
export const FilesPersistedEventData = __stub;
|
|
15
|
+
export type OUTPUTS_SUBDIR = unknown;
|
|
16
|
+
export const OUTPUTS_SUBDIR = __stub;
|
|
17
|
+
export type PersistedFile = unknown;
|
|
18
|
+
export const PersistedFile = __stub;
|
|
19
|
+
export type TurnStartTime = unknown;
|
|
20
|
+
export const TurnStartTime = __stub;
|
|
43
21
|
|
|
44
22
|
export default __stub;
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
type AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS,
|
|
19
19
|
logEvent,
|
|
20
20
|
} from '../services/analytics/index.js'
|
|
21
|
-
import { accumulateUsage, updateUsage } from '../services/api/
|
|
21
|
+
import { accumulateUsage, updateUsage } from '../services/api/ummaya.js'
|
|
22
22
|
import { EMPTY_USAGE, type NonNullableUsage } from '../services/api/logging.js'
|
|
23
23
|
import type { ToolUseContext } from '../Tool.js'
|
|
24
24
|
import type { AgentDefinition } from '../tools/AgentTool/loadAgentsDir.js'
|
|
@@ -197,7 +197,7 @@ function forceExit(exitCode: number): never {
|
|
|
197
197
|
failsafeTimer = undefined
|
|
198
198
|
}
|
|
199
199
|
// Drain stdin LAST, right before exit. cleanupTerminalModes() sent
|
|
200
|
-
// DISABLE_MOUSE_TRACKING early, but the terminal round-trip plus
|
|
200
|
+
// DISABLE_MOUSE_TRACKING early, but the terminal round-trip plus queued
|
|
201
201
|
// events already in flight means bytes can arrive during the seconds
|
|
202
202
|
// of async cleanup between then and now. Draining here catches them.
|
|
203
203
|
// Use the Ink class method (not the standalone drainStdin()) so we
|
|
@@ -240,7 +240,7 @@ export const setupGracefulShutdown = memoize(() => {
|
|
|
240
240
|
// the signal then falls back to its default action (terminate) and our
|
|
241
241
|
// process.on('SIGTERM') handler never runs.
|
|
242
242
|
//
|
|
243
|
-
// Trigger:
|
|
243
|
+
// Trigger: a short-lived signal-exit v4 subscriber (e.g. execa per child
|
|
244
244
|
// process, or an Ink instance that unmounts). When its unsubscribe runs and
|
|
245
245
|
// it was the last v4 subscriber, v4.unload() calls removeListener on every
|
|
246
246
|
// signal in its list (SIGTERM, SIGINT, SIGHUP, …), tripping the Bun bug and
|
|
@@ -380,7 +380,7 @@ export function resetShutdownState(): void {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
/**
|
|
383
|
-
* Returns the in-flight shutdown promise
|
|
383
|
+
* Returns the in-flight shutdown promise when present. Only for use in tests
|
|
384
384
|
* to await completion before restoring mocks.
|
|
385
385
|
*/
|
|
386
386
|
export function getPendingShutdownForTesting(): Promise<void> | undefined {
|
|
@@ -428,7 +428,7 @@ export async function gracefulShutdown(
|
|
|
428
428
|
// Set the exit code that will be used when process naturally exits
|
|
429
429
|
process.exitCode = exitCode
|
|
430
430
|
|
|
431
|
-
// Exit alt screen and print resume hint FIRST, before
|
|
431
|
+
// Exit alt screen and print resume hint FIRST, before async operations.
|
|
432
432
|
// This ensures the hint is visible even if the process is killed during
|
|
433
433
|
// cleanup (e.g., SIGKILL during macOS reboot). Without this, the resume
|
|
434
434
|
// hint would only appear after cleanup functions, hooks, and analytics
|
|
@@ -22,6 +22,15 @@ import { getFsImplementation } from './fsOperations.js'
|
|
|
22
22
|
import { logError } from './log.js'
|
|
23
23
|
import { jsonStringify } from './slowOperations.js'
|
|
24
24
|
|
|
25
|
+
declare global {
|
|
26
|
+
namespace NodeJS {
|
|
27
|
+
interface Process {
|
|
28
|
+
_getActiveHandles(): unknown[]
|
|
29
|
+
_getActiveRequests(): unknown[]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
25
34
|
export type HeapDumpResult = {
|
|
26
35
|
success: boolean
|
|
27
36
|
heapPath?: string
|
|
@@ -103,12 +112,8 @@ export async function captureMemoryDiagnostics(
|
|
|
103
112
|
}
|
|
104
113
|
|
|
105
114
|
// Get active handles/requests count (these are internal APIs but stable)
|
|
106
|
-
const activeHandles = (
|
|
107
|
-
|
|
108
|
-
)._getActiveHandles().length
|
|
109
|
-
const activeRequests = (
|
|
110
|
-
process as unknown as { _getActiveRequests: () => unknown[] }
|
|
111
|
-
)._getActiveRequests().length
|
|
115
|
+
const activeHandles = process._getActiveHandles().length
|
|
116
|
+
const activeRequests = process._getActiveRequests().length
|
|
112
117
|
|
|
113
118
|
// Try to count open file descriptors (Linux/macOS)
|
|
114
119
|
let openFileDescriptors: number | undefined
|
|
@@ -287,8 +292,7 @@ async function writeHeapSnapshot(filepath: string): Promise<void> {
|
|
|
287
292
|
// Use synchronous I/O despite potentially large filesize so that we avoid cloning the string for cross-thread usage.
|
|
288
293
|
//
|
|
289
294
|
/* eslint-disable custom-rules/no-sync-fs -- intentionally sync to avoid cloning large heap snapshot string for cross-thread usage */
|
|
290
|
-
|
|
291
|
-
writeFileSync(filepath, Bun.generateHeapSnapshot('v8', 'arraybuffer'), {
|
|
295
|
+
writeFileSync(filepath, new Uint8Array(Bun.generateHeapSnapshot('v8', 'arraybuffer')), {
|
|
292
296
|
mode: 0o600,
|
|
293
297
|
})
|
|
294
298
|
/* eslint-enable custom-rules/no-sync-fs */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'crypto'
|
|
2
2
|
import type { QuerySource } from '../../constants/querySource.js'
|
|
3
|
-
import { queryModelWithoutStreaming } from '../../services/api/
|
|
3
|
+
import { queryModelWithoutStreaming } from '../../services/api/ummaya.js'
|
|
4
4
|
import type { Message } from '../../types/message.js'
|
|
5
5
|
import { createAbortController } from '../../utils/abortController.js'
|
|
6
6
|
import { logError } from '../../utils/log.js'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { randomUUID } from 'crypto'
|
|
2
2
|
import type { HookEvent } from 'src/entrypoints/agentSdkTypes.js'
|
|
3
|
-
import { queryModelWithoutStreaming } from '../../services/api/
|
|
3
|
+
import { queryModelWithoutStreaming } from '../../services/api/ummaya.js'
|
|
4
4
|
import type { ToolUseContext } from '../../Tool.js'
|
|
5
5
|
import type { Message } from '../../types/message.js'
|
|
6
6
|
import { createAttachmentMessage } from '../attachments.js'
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
type AnalyticsMetadata_I_VERIFIED_THIS_IS_PII_TAGGED,
|
|
7
7
|
logEvent,
|
|
8
8
|
} from '../../services/analytics/index.js'
|
|
9
|
-
import { queryModelWithoutStreaming } from '../../services/api/
|
|
9
|
+
import { queryModelWithoutStreaming } from '../../services/api/ummaya.js'
|
|
10
10
|
import { getEmptyToolPermissionContext } from '../../Tool.js'
|
|
11
11
|
import type { Message } from '../../types/message.js'
|
|
12
12
|
import { createAbortController } from '../abortController.js'
|
|
@@ -432,6 +432,24 @@ export function createAssistantMessage({
|
|
|
432
432
|
})
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
+
export function finalizeStreamingAssistantMessage(params: {
|
|
436
|
+
readonly messages: readonly Message[]
|
|
437
|
+
readonly streamingText: string | null
|
|
438
|
+
readonly turnStartMessageCount: number
|
|
439
|
+
}): readonly Message[] {
|
|
440
|
+
const { messages, streamingText, turnStartMessageCount } = params
|
|
441
|
+
if (streamingText === null || streamingText.trim() === '') {
|
|
442
|
+
return messages
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
const turnMessages = messages.slice(turnStartMessageCount)
|
|
446
|
+
if (turnMessages.some(message => message.type === 'assistant')) {
|
|
447
|
+
return messages
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
return [...messages, createAssistantMessage({ content: streamingText })]
|
|
451
|
+
}
|
|
452
|
+
|
|
435
453
|
export function createAssistantAPIErrorMessage({
|
|
436
454
|
content,
|
|
437
455
|
apiError,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
// - copyFile(src, dest, COPYFILE_EXCL) — fails if dest already exists;
|
|
16
16
|
// skips rather than overwriting.
|
|
17
17
|
// - fsync(dest fd) — durability before unlink.
|
|
18
|
-
// - --prune:
|
|
18
|
+
// - --prune: an unlink-phase error throws + aborts (no partial-prune).
|
|
19
19
|
// - src JSONL never truncated: if copyFile throws, src is untouched.
|
|
20
20
|
//
|
|
21
21
|
// Zero new runtime dependencies (AGENTS.md hard rule).
|
|
@@ -33,7 +33,7 @@ import { getUmmayaSessionsDir } from './ummayaPaths.js'
|
|
|
33
33
|
export interface MigrateSessionsOpts {
|
|
34
34
|
/**
|
|
35
35
|
* When true, unlink each successfully copied source file after fsync.
|
|
36
|
-
* If
|
|
36
|
+
* If an unlink fails, the entire prune phase aborts and throws — no
|
|
37
37
|
* partial-prune state is left.
|
|
38
38
|
*/
|
|
39
39
|
prune?: boolean
|
|
@@ -248,7 +248,7 @@ export async function migrateSessions(
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
// --- Prune phase (only runs when prune: true) ---
|
|
251
|
-
// Invariant:
|
|
251
|
+
// Invariant: unlink failure aborts the entire prune phase and throws.
|
|
252
252
|
// This prevents partial-prune state.
|
|
253
253
|
if (prune && copied.length > 0) {
|
|
254
254
|
for (const src of copied) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// UMMAYA Epic #2112: legacy model-dispatch matrix removed; collapsed to K-EXAONE single branch.
|
|
2
|
-
// Public function signatures preserved per FR-006 caller-reach rule (callers in services/api/
|
|
2
|
+
// Public function signatures preserved per FR-006 caller-reach rule (callers in services/api/ummaya.ts,
|
|
3
3
|
// memdir/findRelevantMemories.ts, utils/attachments.ts, commands/insights.ts, services/tokenEstimation.ts,
|
|
4
4
|
// components/messages/AssistantTextMessage.tsx are bucket B — kept alive until P2 issue #2147 lands).
|
|
5
5
|
//
|
|
@@ -77,19 +77,19 @@ export function getBestModel(): ModelName {
|
|
|
77
77
|
return getDefaultMainLoopModel()
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/
|
|
81
|
-
// import-graph stability. Removed together with services/api/
|
|
80
|
+
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/ummaya.ts
|
|
81
|
+
// import-graph stability. Removed together with services/api/ummaya.ts in Phase P2.
|
|
82
82
|
export function getDefaultOpusModel(): ModelName {
|
|
83
83
|
return getDefaultMainLoopModel()
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/
|
|
86
|
+
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/ummaya.ts
|
|
87
87
|
// import-graph stability.
|
|
88
88
|
export function getDefaultSonnetModel(): ModelName {
|
|
89
89
|
return getDefaultMainLoopModel()
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/
|
|
92
|
+
// [Deferred to P2 — issue #2147]: thin alias preserved for services/api/ummaya.ts
|
|
93
93
|
// import-graph stability.
|
|
94
94
|
export function getDefaultHaikuModel(): ModelName {
|
|
95
95
|
return getDefaultMainLoopModel()
|
|
@@ -130,7 +130,7 @@ export function getDefaultMainLoopModel(): ModelName {
|
|
|
130
130
|
* fail-safe single branch keyed on K-EXAONE detection.
|
|
131
131
|
*
|
|
132
132
|
* [Deferred to P2 — issue #2147]: this function is preserved as an export for
|
|
133
|
-
* services/api/
|
|
133
|
+
* services/api/ummaya.ts callers; removed together with that file in Phase P2.
|
|
134
134
|
*/
|
|
135
135
|
export function firstPartyNameToCanonical(name: ModelName): ModelShortName {
|
|
136
136
|
const lowered = name.toLowerCase()
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import { getFeatureValue_CACHED_MAY_BE_STALE } from '../../services/analytics/growthbook.js'
|
|
14
14
|
import { logEvent } from '../../services/analytics/index.js'
|
|
15
15
|
import type { AnalyticsMetadata_I_VERIFIED_THIS_IS_NOT_CODE_OR_FILEPATHS } from '../../services/analytics/metadata.js'
|
|
16
|
-
import { getCacheControl } from '../../services/api/
|
|
16
|
+
import { getCacheControl } from '../../services/api/ummaya.js'
|
|
17
17
|
import { parsePromptTooLongTokenCounts } from '../../services/api/errors.js'
|
|
18
18
|
import { getDefaultMaxRetries } from '../../services/api/withRetry.js'
|
|
19
19
|
import type { Tool, ToolPermissionContext, Tools } from '../../Tool.js'
|
|
@@ -69,7 +69,7 @@ export async function installPluginsForHeadless(): Promise<boolean> {
|
|
|
69
69
|
|
|
70
70
|
// Declared now includes an implicit claude-plugins-official entry when any
|
|
71
71
|
// enabled plugin references it (see getDeclaredMarketplaces). This routes
|
|
72
|
-
// the official marketplace through the same reconciler path as
|
|
72
|
+
// the official marketplace through the same reconciler path as the others —
|
|
73
73
|
// which composes correctly with CLAUDE_CODE_PLUGIN_SEED_DIR: seed registers
|
|
74
74
|
// it in known_marketplaces.json, reconciler diff sees it as upToDate, no clone.
|
|
75
75
|
const declaredCount = Object.keys(getDeclaredMarketplaces()).length
|
|
@@ -434,7 +434,7 @@ export async function extractMcpServersFromPlugins(
|
|
|
434
434
|
* config (assistant-mode channels). Channel-specific wins on collision so
|
|
435
435
|
* plugins that declare the same key at both levels get the more specific value.
|
|
436
436
|
*
|
|
437
|
-
* Returns undefined when neither source
|
|
437
|
+
* Returns undefined when neither source provides values — resolvePluginMcpEnvironment
|
|
438
438
|
* skips substituteUserConfigVariables in that case.
|
|
439
439
|
*/
|
|
440
440
|
function buildMcpUserConfig(
|
|
@@ -132,7 +132,7 @@ function serverSecretsKey(pluginId: string, serverName: string): string {
|
|
|
132
132
|
* collision shouldn't happen, but if a user hand-edits settings.json we
|
|
133
133
|
* trust the more secure source.
|
|
134
134
|
*
|
|
135
|
-
* Returns null only if NEITHER source
|
|
135
|
+
* Returns null only if NEITHER source provides values — callers skip
|
|
136
136
|
* ${user_config.X} substitution in that case.
|
|
137
137
|
*
|
|
138
138
|
* @param pluginId - Plugin identifier in "plugin@marketplace" format
|
|
@@ -680,7 +680,7 @@ async function installFromGitHub(
|
|
|
680
680
|
/**
|
|
681
681
|
* Resolve a git-subdir `url` field to a clonable git URL.
|
|
682
682
|
* Accepts GitHub owner/repo shorthand (converted to ssh or https depending on
|
|
683
|
-
* CLAUDE_CODE_REMOTE) or
|
|
683
|
+
* CLAUDE_CODE_REMOTE) or a URL that passes validateGitUrl (https, http,
|
|
684
684
|
* file, git@ ssh).
|
|
685
685
|
*/
|
|
686
686
|
function resolveGitSubdirUrl(url: string): string {
|
|
@@ -1335,7 +1335,7 @@ async function validatePluginPaths(
|
|
|
1335
1335
|
* - Hooks: Loads from hooks/hooks.json if present
|
|
1336
1336
|
*
|
|
1337
1337
|
* The function is tolerant of missing components - a plugin can have
|
|
1338
|
-
*
|
|
1338
|
+
* whichever combination of the above directories/files exists. Missing component files
|
|
1339
1339
|
* are reported as errors but don't prevent plugin loading.
|
|
1340
1340
|
*
|
|
1341
1341
|
* @param pluginPath - Absolute path to the plugin directory
|
|
@@ -1343,7 +1343,7 @@ async function validatePluginPaths(
|
|
|
1343
1343
|
* @param enabled - Initial enabled state (may be overridden by settings)
|
|
1344
1344
|
* @param fallbackName - Name to use if manifest doesn't specify one
|
|
1345
1345
|
* @param strict - When true, adds errors for duplicate hook files (default: true)
|
|
1346
|
-
* @returns Object containing the LoadedPlugin and
|
|
1346
|
+
* @returns Object containing the LoadedPlugin and errors encountered
|
|
1347
1347
|
*/
|
|
1348
1348
|
export async function createPluginFromPath(
|
|
1349
1349
|
pluginPath: string,
|
|
@@ -1464,7 +1464,7 @@ export async function createPluginFromPath(
|
|
|
1464
1464
|
if (validPaths.length > 0) {
|
|
1465
1465
|
plugin.commandsPaths = validPaths
|
|
1466
1466
|
}
|
|
1467
|
-
// Set commandsMetadata
|
|
1467
|
+
// Set commandsMetadata when commands exist (file-based or inline)
|
|
1468
1468
|
if (Object.keys(commandsMetadata).length > 0) {
|
|
1469
1469
|
plugin.commandsMetadata = commandsMetadata
|
|
1470
1470
|
}
|
|
@@ -1928,7 +1928,7 @@ async function loadPluginsFromMarketplaces({
|
|
|
1928
1928
|
// loads the plugin unchecked — a silent fail-open. This guard restores
|
|
1929
1929
|
// fail-closed: unknown source + active policy → block.
|
|
1930
1930
|
//
|
|
1931
|
-
// Allowlist:
|
|
1931
|
+
// Allowlist: a configured value (including []) is active — empty allowlist = deny all.
|
|
1932
1932
|
// Blocklist: empty [] is a semantic no-op — only non-empty counts as active.
|
|
1933
1933
|
const strictAllowlist = getStrictKnownMarketplaces()
|
|
1934
1934
|
const blocklist = getBlockedMarketplaces()
|
|
@@ -2185,7 +2185,7 @@ async function loadPluginFromMarketplaceEntryCacheOnly(
|
|
|
2185
2185
|
* omits `version`. Avoids re-cloning external plugins just to discover the
|
|
2186
2186
|
* version we already recorded at install time.
|
|
2187
2187
|
*
|
|
2188
|
-
* Returns both the loaded plugin and
|
|
2188
|
+
* Returns both the loaded plugin and errors encountered during loading.
|
|
2189
2189
|
* Errors include missing component files and hook load failures.
|
|
2190
2190
|
*/
|
|
2191
2191
|
async function loadPluginFromMarketplaceEntry(
|
|
@@ -2923,7 +2923,7 @@ async function finishLoadingPluginFromPath(
|
|
|
2923
2923
|
* They appear with source='plugin-name@inline' and are always enabled for the current session.
|
|
2924
2924
|
*
|
|
2925
2925
|
* @param sessionPluginPaths - Array of plugin directory paths from CLI
|
|
2926
|
-
* @returns LoadedPlugin objects and
|
|
2926
|
+
* @returns LoadedPlugin objects and encountered errors
|
|
2927
2927
|
*/
|
|
2928
2928
|
async function loadSessionOnlyPlugins(
|
|
2929
2929
|
sessionPluginPaths: Array<string>,
|
|
@@ -3056,7 +3056,7 @@ export function mergePluginSources(sources: {
|
|
|
3056
3056
|
})
|
|
3057
3057
|
// Session first, then non-overridden marketplace, then builtin.
|
|
3058
3058
|
// Downstream first-match consumers see session plugins before
|
|
3059
|
-
// installed ones for
|
|
3059
|
+
// installed ones for entries that slipped past the name filter.
|
|
3060
3060
|
return {
|
|
3061
3061
|
plugins: [...sessionPlugins, ...marketplacePlugins, ...sources.builtin],
|
|
3062
3062
|
errors,
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
// CC consumer references (envUtils.ts:142) imply CC has runtime equivalents but they're
|
|
5
5
|
// not in restored-src — UMMAYA NO-OP is justified until TUI Fidelity Meta-Epic
|
|
6
6
|
// decides on UMMAYA-original implementation.
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
export function checkProtectedNamespace(): boolean {
|
|
8
|
+
return false
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default checkProtectedNamespace
|