ummaya 0.2.3 → 0.2.5
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 +17 -3
- package/bin/ummaya +10 -1
- package/npm-shrinkwrap.json +253 -2
- package/package.json +5 -1
- package/prompts/manifest.yaml +2 -2
- package/prompts/session_guidance_v1.md +3 -1
- package/prompts/system_v1.md +9 -7
- package/pyproject.toml +26 -7
- package/specs/2803-document-production-hardening/contracts/document-tools.schema.json +1043 -0
- package/src/ummaya/_canonical/__init__.py +2 -0
- package/src/ummaya/context/builder.py +17 -11
- package/src/ummaya/engine/engine.py +30 -113
- package/src/ummaya/engine/query.py +20 -0
- package/src/ummaya/evidence/__init__.py +44 -0
- package/src/ummaya/evidence/__main__.py +7 -0
- 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 +145 -0
- 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 +177 -0
- package/src/ummaya/evidence/source_provenance.py +246 -0
- package/src/ummaya/evidence/source_provenance_redaction.py +176 -0
- package/src/ummaya/evidence/task_registry.py +264 -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 +52 -5
- package/src/ummaya/ipc/route_diagnostics.py +73 -0
- package/src/ummaya/ipc/stdio.py +2282 -417
- package/src/ummaya/llm/client.py +234 -59
- package/src/ummaya/llm/config.py +8 -3
- package/src/ummaya/llm/reasoning.py +84 -0
- 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 +34 -2
- 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 +114 -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 +61 -12
- package/src/ummaya/tools/geocoding/kakao_client.py +1 -2
- package/src/ummaya/tools/kma/apihub_catalog.py +984 -1
- package/src/ummaya/tools/kma/apihub_structured_adapter.py +86 -6
- package/src/ummaya/tools/kma/apihub_url_adapter.py +593 -0
- package/src/ummaya/tools/kma/apihub_url_catalog.py +296 -0
- package/src/ummaya/tools/live_proxy.py +0 -3
- package/src/ummaya/tools/location_adapters.py +8 -6
- package/src/ummaya/tools/manifest_metadata.py +16 -3
- package/src/ummaya/tools/models.py +5 -1
- package/src/ummaya/tools/mvp_surface.py +2 -2
- package/src/ummaya/tools/nmc/emergency_search.py +8 -6
- package/src/ummaya/tools/register_all.py +17 -0
- package/src/ummaya/tools/registry.py +10 -1
- package/src/ummaya/tools/resolve_location.py +4 -4
- 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 +40 -106
- package/src/ummaya/tools/verified_data_go_kr/_manifest.py +115 -25
- package/src/ummaya/tools/verified_data_go_kr/airkorea_air_quality.py +109 -4
- package/src/ummaya/tools/verified_data_go_kr/nmc_aed_site.py +108 -2
- package/src/ummaya/tools/verified_data_go_kr/pps_bid_public_info.py +174 -9
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_arrival.py +66 -3
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_location.py +12 -2
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_route.py +8 -2
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_route_station.py +114 -0
- package/src/ummaya/tools/verified_data_go_kr/tago_bus_station.py +14 -3
- package/src/ummaya/tools/verify_canonical_map.py +21 -0
- package/tests/fixtures/documents/public_forms/baselines.yaml +113 -0
- package/tui/package.json +1 -2
- package/tui/src/.cc-byte-identical-whitelist.yaml +266 -0
- package/tui/src/QueryEngine.ts +12 -4
- package/tui/src/bridge/inboundAttachments.ts +3 -3
- package/tui/src/cli/handlers/auth.ts +4 -13
- package/tui/src/cli/handlers/mcp.tsx +3 -3
- package/tui/src/cli/print.ts +69 -18
- package/tui/src/cli/update.ts +13 -13
- package/tui/src/commands/copy/index.ts +1 -1
- package/tui/src/commands/cost/cost.ts +2 -2
- package/tui/src/commands/init-verifiers.ts +5 -5
- package/tui/src/commands/init.ts +30 -30
- package/tui/src/commands/insights.ts +44 -44
- package/tui/src/commands/install-github-app/install-github-app.tsx +2 -2
- package/tui/src/commands/install-github-app/setupGitHubActions.ts +3 -3
- package/tui/src/commands/install-github-app/types.ts +8 -30
- package/tui/src/commands/install.tsx +5 -5
- package/tui/src/commands/mcp/addCommand.ts +5 -5
- package/tui/src/commands/mcp/xaaIdpCommand.ts +2 -2
- package/tui/src/commands/plugin/ManageMarketplaces.tsx +2 -2
- package/tui/src/commands/plugin/types.ts +6 -28
- package/tui/src/commands/plugin/unifiedTypes.ts +4 -26
- package/tui/src/commands/reasoning/index.ts +13 -0
- package/tui/src/commands/reasoning/reasoning.tsx +177 -0
- package/tui/src/commands/rename/generateSessionName.ts +1 -1
- package/tui/src/commands/thinkback/thinkback.tsx +3 -3
- package/tui/src/commands.ts +2 -0
- 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/Messages.tsx +2 -1
- package/tui/src/components/ScrollKeybindingHandler.tsx +6 -6
- package/tui/src/components/Spinner/types.ts +6 -28
- package/tui/src/components/Spinner.tsx +2 -2
- 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/design-system/LoadingState.tsx +2 -2
- 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 +29 -3
- package/tui/src/ipc/frames.generated.ts +407 -312
- package/tui/src/ipc/llmClient.ts +279 -76
- package/tui/src/ipc/llmTypes.ts +16 -1
- package/tui/src/ipc/schema/frame.schema.json +1 -3475
- package/tui/src/keybindings/defaultBindings.ts +4 -0
- package/tui/src/main.tsx +32 -11
- 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 -1721
- package/tui/src/screens/REPL.tsx +42 -31
- 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 +98 -14
- 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 -364
- 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/skills/bundled/stuck.ts +12 -12
- package/tui/src/state/AppStateStore.ts +7 -0
- 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 +1239 -163
- 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 +48 -29
- package/tui/src/tools/LookupPrimitive/prompt.ts +6 -7
- 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 +30 -19
- 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 +51 -18
- 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 +27 -10
- 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/citizenUserText.ts +49 -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/locationInputRepair.ts +112 -0
- package/tui/src/tools/_shared/pendingCallRegistry.ts +1 -6
- package/tui/src/tools/_shared/rootPrimitiveInput.ts +68 -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 +61 -0
- 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/attachments.ts +1 -1
- 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/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/kExaoneReasoning.ts +138 -0
- package/tui/src/utils/mcp/dateTimeParser.ts +1 -1
- package/tui/src/utils/messages.ts +19 -0
- package/tui/src/utils/migrateSessions.ts +3 -3
- package/tui/src/utils/model/model.ts +6 -6
- package/tui/src/utils/multiToolLayout.ts +13 -0
- 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/processUserInput/processSlashCommand.tsx +2 -2
- package/tui/src/utils/processUserInput/processUserInput.ts +26 -0
- 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/applySettingsChange.ts +4 -0
- package/tui/src/utils/settings/permissionValidation.ts +14 -2
- package/tui/src/utils/settings/types.ts +9 -3
- package/tui/src/utils/shell/prefix.ts +1 -1
- package/tui/src/utils/sideQuery.ts +1 -1
- package/tui/src/utils/stats.ts +1 -1
- package/tui/src/utils/systemThemeWatcher.ts +13 -3
- package/tui/src/utils/teleport.tsx +1 -1
- package/uv.lock +394 -22
- package/assets/copilot-gate-logo.svg +0 -58
- package/assets/govon-logo.svg +0 -40
- package/src/ummaya/eval/__init__.py +0 -5
- package/src/ummaya/eval/retrieval.py +0 -713
- package/tui/src/services/api/claude.ts +0 -3510
- package/tui/src/utils/messageStream.ts +0 -186
|
@@ -51,7 +51,9 @@ import {
|
|
|
51
51
|
import {
|
|
52
52
|
getAdapterToolByName,
|
|
53
53
|
isAdapterToolName,
|
|
54
|
+
isRootPrimitiveToolName,
|
|
54
55
|
} from '../../tools/AdapterTool/AdapterTool.js'
|
|
56
|
+
import { appendRouteDiagnostic } from '../../tools/AdapterTool/routeDiagnostics.js'
|
|
55
57
|
import { getAllBaseTools } from '../../tools.js'
|
|
56
58
|
import type { HookProgress } from '../../types/hooks.js'
|
|
57
59
|
import type {
|
|
@@ -356,7 +358,15 @@ export async function* runToolUse(
|
|
|
356
358
|
// Only use fallback if the tool was found via alias (deprecated name)
|
|
357
359
|
if (
|
|
358
360
|
fallbackTool &&
|
|
359
|
-
(fallbackTool.aliases?.includes(toolName) ||
|
|
361
|
+
(fallbackTool.aliases?.includes(toolName) ||
|
|
362
|
+
isAdapterToolName(toolName) ||
|
|
363
|
+
(
|
|
364
|
+
isDeferredTool(fallbackTool) &&
|
|
365
|
+
isToolSearchToolAvailable(toolUseContext.options.tools) &&
|
|
366
|
+
extractDiscoveredToolNames(toolUseContext.messages ?? []).has(
|
|
367
|
+
fallbackTool.name,
|
|
368
|
+
)
|
|
369
|
+
))
|
|
360
370
|
) {
|
|
361
371
|
tool = fallbackTool
|
|
362
372
|
}
|
|
@@ -366,6 +376,21 @@ export async function* runToolUse(
|
|
|
366
376
|
}
|
|
367
377
|
const messageId = assistantMessage.message.id
|
|
368
378
|
const requestId = assistantMessage.requestId
|
|
379
|
+
const isAdapterTool = isAdapterToolName(toolName)
|
|
380
|
+
const isRouteTool = isAdapterTool || isRootPrimitiveToolName(toolName)
|
|
381
|
+
const routeTargetToolId = extractRouteTargetToolId(toolUse.input)
|
|
382
|
+
if (isRouteTool) {
|
|
383
|
+
appendRouteDiagnostic('route_tool_dispatch', {
|
|
384
|
+
tool_name: toolName,
|
|
385
|
+
tool_surface: isAdapterTool ? 'concrete_adapter' : 'root_primitive',
|
|
386
|
+
target_tool_id: routeTargetToolId,
|
|
387
|
+
tool_use_id: toolUse.id,
|
|
388
|
+
message_id: messageId,
|
|
389
|
+
request_id: requestId ?? null,
|
|
390
|
+
query_chain_id: toolUseContext.queryTracking?.chainId ?? null,
|
|
391
|
+
query_depth: toolUseContext.queryTracking?.depth ?? null,
|
|
392
|
+
})
|
|
393
|
+
}
|
|
369
394
|
const mcpServerType = getMcpServerType(
|
|
370
395
|
toolName,
|
|
371
396
|
toolUseContext.options.mcpClients,
|
|
@@ -762,6 +787,9 @@ async function checkPermissionsAndCallTool(
|
|
|
762
787
|
}
|
|
763
788
|
|
|
764
789
|
const resultingMessages = []
|
|
790
|
+
const isAdapterTool = isAdapterToolName(tool.name)
|
|
791
|
+
const isRouteTool = isAdapterTool || isRootPrimitiveToolName(tool.name)
|
|
792
|
+
const toolSurface = isAdapterTool ? 'concrete_adapter' : 'root_primitive'
|
|
765
793
|
|
|
766
794
|
// Defense-in-depth: strip _simulatedSedEdit from model-provided Bash input.
|
|
767
795
|
// This field is internal-only — it must only be injected by the permission
|
|
@@ -1003,6 +1031,21 @@ async function checkPermissionsAndCallTool(
|
|
|
1003
1031
|
}
|
|
1004
1032
|
|
|
1005
1033
|
if (permissionDecision.behavior !== 'allow') {
|
|
1034
|
+
if (isRouteTool) {
|
|
1035
|
+
appendRouteDiagnostic('route_tool_permission', {
|
|
1036
|
+
tool_name: tool.name,
|
|
1037
|
+
tool_surface: toolSurface,
|
|
1038
|
+
target_tool_id: extractRouteTargetToolId(processedInput),
|
|
1039
|
+
tool_use_id: toolUseID,
|
|
1040
|
+
message_id: messageId,
|
|
1041
|
+
request_id: requestId ?? null,
|
|
1042
|
+
query_chain_id: toolUseContext.queryTracking?.chainId ?? null,
|
|
1043
|
+
query_depth: toolUseContext.queryTracking?.depth ?? null,
|
|
1044
|
+
permission_mode: permissionMode,
|
|
1045
|
+
permission_behavior: permissionDecision.behavior,
|
|
1046
|
+
result_status: 'blocked',
|
|
1047
|
+
})
|
|
1048
|
+
}
|
|
1006
1049
|
logForDebugging(`${tool.name} tool permission denied`)
|
|
1007
1050
|
const decisionInfo = toolUseContext.toolDecisions?.get(toolUseID)
|
|
1008
1051
|
endToolBlockedOnUserSpan('reject', decisionInfo?.source || 'unknown')
|
|
@@ -1214,6 +1257,20 @@ async function checkPermissionsAndCallTool(
|
|
|
1214
1257
|
callInput = processedInput
|
|
1215
1258
|
}
|
|
1216
1259
|
try {
|
|
1260
|
+
if (isRouteTool) {
|
|
1261
|
+
appendRouteDiagnostic('route_tool_call_start', {
|
|
1262
|
+
tool_name: tool.name,
|
|
1263
|
+
tool_surface: toolSurface,
|
|
1264
|
+
target_tool_id: extractRouteTargetToolId(callInput),
|
|
1265
|
+
tool_use_id: toolUseID,
|
|
1266
|
+
message_id: messageId,
|
|
1267
|
+
request_id: requestId ?? null,
|
|
1268
|
+
query_chain_id: toolUseContext.queryTracking?.chainId ?? null,
|
|
1269
|
+
query_depth: toolUseContext.queryTracking?.depth ?? null,
|
|
1270
|
+
permission_mode: permissionMode,
|
|
1271
|
+
permission_behavior: permissionDecision.behavior,
|
|
1272
|
+
})
|
|
1273
|
+
}
|
|
1217
1274
|
const result = await tool.call(
|
|
1218
1275
|
callInput,
|
|
1219
1276
|
{
|
|
@@ -1309,6 +1366,21 @@ async function checkPermissionsAndCallTool(
|
|
|
1309
1366
|
: typeof mappedContent === 'string'
|
|
1310
1367
|
? mappedContent.length
|
|
1311
1368
|
: jsonStringify(mappedContent).length
|
|
1369
|
+
if (isRouteTool) {
|
|
1370
|
+
appendRouteDiagnostic('route_tool_result', {
|
|
1371
|
+
tool_name: tool.name,
|
|
1372
|
+
tool_surface: toolSurface,
|
|
1373
|
+
target_tool_id: extractRouteTargetToolId(callInput),
|
|
1374
|
+
tool_use_id: toolUseID,
|
|
1375
|
+
message_id: messageId,
|
|
1376
|
+
request_id: requestId ?? null,
|
|
1377
|
+
query_chain_id: toolUseContext.queryTracking?.chainId ?? null,
|
|
1378
|
+
query_depth: toolUseContext.queryTracking?.depth ?? null,
|
|
1379
|
+
duration_ms: durationMs,
|
|
1380
|
+
result_status: 'success',
|
|
1381
|
+
tool_result_size_bytes: toolResultSizeBytes,
|
|
1382
|
+
})
|
|
1383
|
+
}
|
|
1312
1384
|
|
|
1313
1385
|
// Extract file extension for file-related tools
|
|
1314
1386
|
let fileExtension: ReturnType<typeof getFileExtensionForAnalytics>
|
|
@@ -1605,6 +1677,21 @@ async function checkPermissionsAndCallTool(
|
|
|
1605
1677
|
error: errorMessage(error),
|
|
1606
1678
|
})
|
|
1607
1679
|
endToolSpan()
|
|
1680
|
+
if (isRouteTool) {
|
|
1681
|
+
appendRouteDiagnostic('route_tool_result', {
|
|
1682
|
+
tool_name: tool.name,
|
|
1683
|
+
tool_surface: toolSurface,
|
|
1684
|
+
target_tool_id: extractRouteTargetToolId(callInput),
|
|
1685
|
+
tool_use_id: toolUseID,
|
|
1686
|
+
message_id: messageId,
|
|
1687
|
+
request_id: requestId ?? null,
|
|
1688
|
+
query_chain_id: toolUseContext.queryTracking?.chainId ?? null,
|
|
1689
|
+
query_depth: toolUseContext.queryTracking?.depth ?? null,
|
|
1690
|
+
duration_ms: durationMs,
|
|
1691
|
+
result_status: 'error',
|
|
1692
|
+
error_kind: classifyToolError(error),
|
|
1693
|
+
})
|
|
1694
|
+
}
|
|
1608
1695
|
|
|
1609
1696
|
// Handle MCP auth errors by updating the client status to 'needs-auth'
|
|
1610
1697
|
// This updates the /mcp display to show the server needs re-authorization
|
|
@@ -1753,3 +1840,9 @@ async function checkPermissionsAndCallTool(
|
|
|
1753
1840
|
}
|
|
1754
1841
|
}
|
|
1755
1842
|
}
|
|
1843
|
+
|
|
1844
|
+
function extractRouteTargetToolId(input: unknown): string | null {
|
|
1845
|
+
if (!input || typeof input !== 'object') return null
|
|
1846
|
+
const value = (input as { tool_id?: unknown }).tool_id
|
|
1847
|
+
return typeof value === 'string' ? value : null
|
|
1848
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { registerBundledSkill } from '../bundledSkills.js'
|
|
2
2
|
|
|
3
|
-
// Prompt text contains `ps` commands as instructions for
|
|
3
|
+
// Prompt text contains `ps` commands as instructions for UMMAYA to run,
|
|
4
4
|
// not commands this file executes.
|
|
5
5
|
// eslint-disable-next-line custom-rules/no-direct-ps-commands
|
|
6
|
-
const STUCK_PROMPT = `# /stuck — diagnose frozen/slow
|
|
6
|
+
const STUCK_PROMPT = `# /stuck — diagnose frozen/slow UMMAYA sessions
|
|
7
7
|
|
|
8
|
-
The user thinks another
|
|
8
|
+
The user thinks another UMMAYA session on this machine is frozen, stuck, or very slow. Investigate and post a report to the configured UMMAYA feedback channel.
|
|
9
9
|
|
|
10
10
|
## What to look for
|
|
11
11
|
|
|
12
|
-
Scan for other
|
|
12
|
+
Scan for other UMMAYA processes (excluding the current one — PID is in \`process.pid\` but for shell commands just exclude the PID you see running this prompt). Process names are typically \`ummaya\` (installed) or \`cli\` (native dev build).
|
|
13
13
|
|
|
14
14
|
Signs of a stuck session:
|
|
15
15
|
- **High CPU (≥90%) sustained** — likely an infinite loop. Sample twice, 1-2s apart, to confirm it's not a transient spike.
|
|
@@ -21,17 +21,17 @@ Signs of a stuck session:
|
|
|
21
21
|
|
|
22
22
|
## Investigation steps
|
|
23
23
|
|
|
24
|
-
1. **List all
|
|
24
|
+
1. **List all UMMAYA processes** (macOS/Linux):
|
|
25
25
|
\`\`\`
|
|
26
|
-
ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(
|
|
26
|
+
ps -axo pid=,pcpu=,rss=,etime=,state=,comm=,command= | grep -E '(ummaya|cli)' | grep -v grep
|
|
27
27
|
\`\`\`
|
|
28
|
-
Filter to rows where \`comm\` is \`
|
|
28
|
+
Filter to rows where \`comm\` is \`ummaya\` or (\`cli\` AND the command path contains "ummaya").
|
|
29
29
|
|
|
30
30
|
2. **For anything suspicious**, gather more context:
|
|
31
31
|
- Child processes: \`pgrep -lP <pid>\`
|
|
32
32
|
- If high CPU: sample again after 1-2s to confirm it's sustained
|
|
33
33
|
- If a child looks hung (e.g., a git command), note its full command line with \`ps -p <child_pid> -o command=\`
|
|
34
|
-
- Check the session's debug log if you can infer the session ID: \`~/.
|
|
34
|
+
- Check the session's debug log if you can infer the session ID: \`~/.ummaya/debug/<session-id>.txt\` (the last few hundred lines often show what it was doing before hanging)
|
|
35
35
|
|
|
36
36
|
3. **Consider a stack dump** for a truly frozen process (advanced, optional):
|
|
37
37
|
- macOS: \`sample <pid> 3\` gives a 3-second native stack sample
|
|
@@ -41,17 +41,17 @@ Signs of a stuck session:
|
|
|
41
41
|
|
|
42
42
|
**Only post to Slack if you actually found something stuck.** If every session looks healthy, tell the user that directly — do not post an all-clear to the channel.
|
|
43
43
|
|
|
44
|
-
If you did find a stuck/slow session, post to
|
|
44
|
+
If you did find a stuck/slow session, post to the configured UMMAYA feedback channel using the Slack MCP tool. Use ToolSearch to find \`slack_send_message\` if it's not already loaded.
|
|
45
45
|
|
|
46
46
|
**Use a two-message structure** to keep the channel scannable:
|
|
47
47
|
|
|
48
|
-
1. **Top-level message** — one short line: hostname,
|
|
48
|
+
1. **Top-level message** — one short line: hostname, UMMAYA version, and a terse symptom (e.g. "session PID 12345 pegged at 100% CPU for 10min" or "git subprocess hung in D state"). No code blocks, no details.
|
|
49
49
|
2. **Thread reply** — the full diagnostic dump. Pass the top-level message's \`ts\` as \`thread_ts\`. Include:
|
|
50
50
|
- PID, CPU%, RSS, state, uptime, command line, child processes
|
|
51
51
|
- Your diagnosis of what's likely wrong
|
|
52
52
|
- Relevant debug log tail or \`sample\` output if you captured it
|
|
53
53
|
|
|
54
|
-
If Slack MCP isn't available, format the report as a message the user can copy-paste into
|
|
54
|
+
If Slack MCP isn't available, format the report as a message the user can copy-paste into the configured UMMAYA feedback channel (and let them know to thread the details themselves).
|
|
55
55
|
|
|
56
56
|
## Notes
|
|
57
57
|
- Don't kill or signal any processes — this is diagnostic only.
|
|
@@ -66,7 +66,7 @@ export function registerStuckSkill(): void {
|
|
|
66
66
|
registerBundledSkill({
|
|
67
67
|
name: 'stuck',
|
|
68
68
|
description:
|
|
69
|
-
'[ANT-ONLY] Investigate frozen/stuck/slow
|
|
69
|
+
'[ANT-ONLY] Investigate frozen/stuck/slow UMMAYA sessions on this machine and post a diagnostic report to the configured UMMAYA feedback channel.',
|
|
70
70
|
userInvocable: true,
|
|
71
71
|
async getPromptForCommand(args) {
|
|
72
72
|
let prompt = STUCK_PROMPT
|
|
@@ -35,6 +35,10 @@ import type { DenialTrackingState } from '../utils/permissions/denialTracking.js
|
|
|
35
35
|
import type { PermissionMode } from '../utils/permissions/PermissionMode.js'
|
|
36
36
|
import { getInitialSettings } from '../utils/settings/settings.js'
|
|
37
37
|
import type { SettingsJson } from '../utils/settings/types.js'
|
|
38
|
+
import {
|
|
39
|
+
getInitialReasoningModeSetting,
|
|
40
|
+
type ReasoningMode,
|
|
41
|
+
} from '../utils/kExaoneReasoning.js'
|
|
38
42
|
import { shouldEnableThinkingByDefault } from '../utils/thinking.js'
|
|
39
43
|
import type { Store } from './store.js'
|
|
40
44
|
|
|
@@ -425,6 +429,8 @@ export type AppState = DeepImmutable<{
|
|
|
425
429
|
advisorModel?: string
|
|
426
430
|
// Effort value
|
|
427
431
|
effortValue?: EffortValue
|
|
432
|
+
// K-EXAONE/FriendliAI reasoning payload policy.
|
|
433
|
+
reasoningMode?: ReasoningMode
|
|
428
434
|
// Set synchronously in launchUltraplan before the detached flow starts.
|
|
429
435
|
// Prevents duplicate launches during the ~5s window before
|
|
430
436
|
// ultraplanSessionUrl is set by teleportToRemote. Cleared by launchDetached
|
|
@@ -563,6 +569,7 @@ export function getDefaultAppState(): AppState {
|
|
|
563
569
|
authVersion: 0,
|
|
564
570
|
initialMessage: null,
|
|
565
571
|
effortValue: undefined,
|
|
572
|
+
reasoningMode: getInitialReasoningModeSetting(),
|
|
566
573
|
activeOverlays: new Set<string>(),
|
|
567
574
|
fastMode: false,
|
|
568
575
|
}
|
|
@@ -26,7 +26,7 @@ import type { PermissionDecision } from '../ipc/codec.js'
|
|
|
26
26
|
/** The shape exposed to PermissionGauntletModal (no resolver, no enqueued_at) */
|
|
27
27
|
export interface PendingPermissionRequest {
|
|
28
28
|
request_id: string
|
|
29
|
-
primitive_kind: 'find' | 'locate' | 'check' | 'send'
|
|
29
|
+
primitive_kind: 'find' | 'locate' | 'check' | 'send' | 'document'
|
|
30
30
|
description_ko: string
|
|
31
31
|
description_en: string
|
|
32
32
|
risk_level: 'low' | 'medium' | 'high'
|
|
@@ -219,7 +219,7 @@ function sessionReducer(
|
|
|
219
219
|
}
|
|
220
220
|
const messages = new Map(state.messages)
|
|
221
221
|
messages.set(action.message_id, updated)
|
|
222
|
-
return { ...state, messages }
|
|
222
|
+
return { ...state, messages, message_order: state.messages.has(action.message_id) ? state.message_order : [...state.message_order, action.message_id] }
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
case 'TOOL_RESULT': {
|
|
@@ -454,32 +454,9 @@ export const resolvePermissionDecision = _resolvePermissionDecision
|
|
|
454
454
|
export const getActivePermission = _getActivePermission
|
|
455
455
|
|
|
456
456
|
// ---------------------------------------------------------------------------
|
|
457
|
-
// Derived agent-loop probes —
|
|
458
|
-
//
|
|
459
|
-
//
|
|
460
|
-
// `ASSISTANT_CHUNK` for a given message_id, and `ERROR`. `TOOL_CALL` reaches
|
|
461
|
-
// the reducer with its own `msg-${call_id}` message_id and creates a synthetic
|
|
462
|
-
// assistant message via `getOrCreateAssistantMessage()` — but the reducer does
|
|
463
|
-
// NOT push that id onto `message_order` (see lines 206-215). That means a
|
|
464
|
-
// tool call that arrives before any assistant chunk lives in `messages` but
|
|
465
|
-
// not in `message_order`, so a probe that only peeks the last entry of
|
|
466
|
-
// `message_order` misreports the loop as idle.
|
|
467
|
-
//
|
|
468
|
-
// The previous in-tree probes in `tui.tsx` had exactly this bug:
|
|
469
|
-
// - `isAgentLoopActive` returned false when the in-flight work was a
|
|
470
|
-
// tool-call-only message (no streamed delta yet). Downstream consumers
|
|
471
|
-
// read idle:
|
|
472
|
-
// * `session-exit` (ctrl+d) skipped its FR-015 active-loop confirmation.
|
|
473
|
-
// * `agent-interrupt` (ctrl+c) armed exit instead of cancelling.
|
|
474
|
-
// - `currentToolCallId` had the same iteration bug and returned null even
|
|
475
|
-
// when a tool call was genuinely in flight.
|
|
476
|
-
//
|
|
477
|
-
// The fix below derives both values from the full `messages` map so a message
|
|
478
|
-
// that only exists in the map (not yet in `message_order`) still participates.
|
|
479
|
-
// These helpers are pure functions — callers memoise them with
|
|
480
|
-
// `React.useCallback` against the map reference, which the reducer already
|
|
481
|
-
// rebuilds on every relevant mutation. They are exported so unit tests can
|
|
482
|
-
// exercise the probes without mounting the full provider tree.
|
|
457
|
+
// Derived agent-loop probes — keep liveness tied to actual message state, not
|
|
458
|
+
// only render order, so cancellation/exit checks keep working if ordering and
|
|
459
|
+
// execution state ever diverge again.
|
|
483
460
|
// ---------------------------------------------------------------------------
|
|
484
461
|
|
|
485
462
|
/**
|
|
@@ -490,10 +467,9 @@ export const getActivePermission = _getActivePermission
|
|
|
490
467
|
* visible to this probe even when no `ASSISTANT_CHUNK` has pushed its id into
|
|
491
468
|
* the order array.
|
|
492
469
|
*
|
|
493
|
-
* Intentionally scans the full map (O(n) in message count).
|
|
494
|
-
* bounded in practice
|
|
495
|
-
*
|
|
496
|
-
* keystroke — not on every render.
|
|
470
|
+
* Intentionally scans the full map (O(n) in message count). Session size is
|
|
471
|
+
* bounded in practice, and each call site runs on a citizen keystroke rather
|
|
472
|
+
* than every render.
|
|
497
473
|
*/
|
|
498
474
|
export function computeIsAgentLoopActive(
|
|
499
475
|
messages: ReadonlyMap<string, Message>,
|
|
@@ -518,11 +494,9 @@ export function computeIsAgentLoopActive(
|
|
|
518
494
|
* Returns the `call_id` of the most recently registered tool call that has no
|
|
519
495
|
* matching `tool_result`, or null when no tool call is in flight.
|
|
520
496
|
*
|
|
521
|
-
* Uses `messages` map insertion order
|
|
522
|
-
*
|
|
523
|
-
*
|
|
524
|
-
* That matches the intent of "most recent" without relying on
|
|
525
|
-
* `message_order`, which `TOOL_CALL` does not update.
|
|
497
|
+
* Uses `messages` map insertion order, which appends for a fresh key and
|
|
498
|
+
* preserves position for an existing key (JS `Map` contract). That matches the
|
|
499
|
+
* intent of "most recent" without depending on render ordering.
|
|
526
500
|
*/
|
|
527
501
|
export function computeCurrentToolCallId(
|
|
528
502
|
messages: ReadonlyMap<string, Message>,
|
|
@@ -2,14 +2,18 @@
|
|
|
2
2
|
// Stage-1 NO-OP stub — resolves unreachable CC-only module imports so the
|
|
3
3
|
// runtime bundle loads. Real implementations are tracked in the CC TUI
|
|
4
4
|
// Fidelity Meta-Epic (Epic #1633).
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
5
|
|
|
7
|
-
|
|
6
|
+
export type StubFunction = (..._args: readonly unknown[]) => unknown
|
|
7
|
+
|
|
8
|
+
const __noop = (..._args: readonly unknown[]): undefined => undefined
|
|
8
9
|
|
|
9
10
|
// Smart Proxy that cooperates with primitive coercion / iteration / JSON
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
export function createStub(): StubFunction {
|
|
12
|
+
let stub: StubFunction
|
|
13
|
+
const target = function stubTarget(..._args: readonly unknown[]): unknown {
|
|
14
|
+
return stub
|
|
15
|
+
}
|
|
16
|
+
stub = new Proxy(target, {
|
|
13
17
|
get(_t, p) {
|
|
14
18
|
// Well-known symbols used by JS engine during coercion
|
|
15
19
|
if (p === Symbol.toPrimitive) return () => ''
|
|
@@ -28,19 +32,20 @@ const makeStub = (): any => {
|
|
|
28
32
|
if (p === 'message') return ''
|
|
29
33
|
if (p === 'stack') return ''
|
|
30
34
|
if (p === 'constructor') return Object
|
|
31
|
-
return
|
|
35
|
+
return stub
|
|
32
36
|
},
|
|
33
|
-
apply() { return
|
|
34
|
-
construct() { return
|
|
37
|
+
apply() { return stub },
|
|
38
|
+
construct() { return stub },
|
|
35
39
|
})
|
|
40
|
+
return stub
|
|
36
41
|
}
|
|
37
42
|
|
|
38
|
-
const __stub
|
|
43
|
+
const __stub = createStub()
|
|
39
44
|
|
|
40
45
|
export default __stub
|
|
41
46
|
|
|
42
47
|
// Common utility exports for lodash-es-style consumers
|
|
43
|
-
export const memoize = <T
|
|
48
|
+
export const memoize = <T>(fn: T): T => fn
|
|
44
49
|
export const sample = <T>(arr: readonly T[]): T | undefined =>
|
|
45
50
|
arr[Math.floor(Math.random() * arr.length)]
|
|
46
51
|
export const tokenize = (input: string): unknown[] => [input]
|
|
@@ -2,33 +2,47 @@
|
|
|
2
2
|
// Anthropic's internal native module is not publicly available. UMMAYA disables
|
|
3
3
|
// syntax highlighting at the source level (CLAUDE_CODE_SYNTAX_HIGHLIGHT=0 is
|
|
4
4
|
// the documented gate); these exports keep consumer types honest.
|
|
5
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
6
5
|
|
|
7
6
|
export type SyntaxTheme = {
|
|
8
|
-
name: string
|
|
9
|
-
colors: Record<string, string
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export
|
|
13
|
-
constructor(
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
7
|
+
readonly name: string
|
|
8
|
+
readonly colors: Record<string, string>
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export class ColorDiff {
|
|
12
|
+
constructor(
|
|
13
|
+
_hunk: unknown,
|
|
14
|
+
_firstLine: string | null,
|
|
15
|
+
_filePath: string,
|
|
16
|
+
_prefixContent?: string | null,
|
|
17
|
+
) {}
|
|
18
|
+
|
|
19
|
+
diff(): string[] {
|
|
20
|
+
return []
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
render(_themeName: string, _width: number, _dim: boolean): string[] | null {
|
|
24
|
+
return []
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export class ColorFile {
|
|
29
|
+
constructor(
|
|
30
|
+
_code: string,
|
|
31
|
+
_filePath: string,
|
|
32
|
+
) {}
|
|
33
|
+
|
|
34
|
+
read(): string {
|
|
35
|
+
return ''
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
render(_themeName: string, _width: number, _dim: boolean): string[] | null {
|
|
39
|
+
return []
|
|
40
|
+
}
|
|
41
|
+
}
|
|
28
42
|
|
|
29
43
|
export const getSyntaxTheme = (..._args: unknown[]): SyntaxTheme => ({
|
|
30
44
|
name: 'no-op',
|
|
31
45
|
colors: {},
|
|
32
|
-
})
|
|
46
|
+
})
|
|
33
47
|
|
|
34
|
-
export default { ColorDiff, ColorFile, getSyntaxTheme }
|
|
48
|
+
export default { ColorDiff, ColorFile, getSyntaxTheme }
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
// TypeScript needs these to type-check the bare `MACRO.VERSION` references
|
|
4
4
|
// throughout the CC 2.1.88 source.
|
|
5
5
|
|
|
6
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
7
|
-
|
|
8
6
|
declare const MACRO: {
|
|
9
7
|
VERSION: string
|
|
10
8
|
VERSION_CHANGELOG: string
|
|
@@ -30,7 +28,9 @@ declare type PromiseWithResolvers<T> = ReturnType<PromiseConstructor['withResolv
|
|
|
30
28
|
|
|
31
29
|
// lodash-es sub-path modules don't ship their own .d.ts files — declare them.
|
|
32
30
|
declare module 'lodash-es/memoize.js' {
|
|
33
|
-
const memoize: <
|
|
31
|
+
const memoize: <Args extends unknown[], Result>(
|
|
32
|
+
fn: (...args: Args) => Result,
|
|
33
|
+
) => (...args: Args) => Result
|
|
34
34
|
export default memoize
|
|
35
35
|
}
|
|
36
36
|
declare module 'lodash-es/mapValues.js' {
|
|
@@ -7,7 +7,16 @@
|
|
|
7
7
|
// succeeds and the splash renders.
|
|
8
8
|
//
|
|
9
9
|
// Referenced from `bunfig.toml` `preload = ["./src/stubs/macro-preload.ts"]`.
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
type ProcessExit = typeof process.exit
|
|
12
|
+
|
|
13
|
+
declare global {
|
|
14
|
+
namespace NodeJS {
|
|
15
|
+
interface Process {
|
|
16
|
+
_origExit?: ProcessExit
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
11
20
|
|
|
12
21
|
// ═══════════════════════════════════════════════════════════════════════
|
|
13
22
|
// bun:bundle virtual module plugin
|
|
@@ -17,10 +26,8 @@
|
|
|
17
26
|
// implementation when the bundler path supports plugin-time resolution.
|
|
18
27
|
// ═══════════════════════════════════════════════════════════════════════
|
|
19
28
|
try {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
if (bunGlobal && typeof bunGlobal.plugin === 'function') {
|
|
23
|
-
bunGlobal.plugin({
|
|
29
|
+
if (typeof Bun !== 'undefined' && typeof Bun.plugin === 'function') {
|
|
30
|
+
Bun.plugin({
|
|
24
31
|
name: 'ummaya-bun-bundle-shim',
|
|
25
32
|
setup(build: {
|
|
26
33
|
onResolve: (
|
|
@@ -56,7 +63,7 @@ try {
|
|
|
56
63
|
// byte-stable across machines.
|
|
57
64
|
import pkg from '../../package.json' with { type: 'json' }
|
|
58
65
|
|
|
59
|
-
|
|
66
|
+
const runtimeMacro = {
|
|
60
67
|
VERSION: pkg.version,
|
|
61
68
|
VERSION_CHANGELOG: 'https://github.com/umyunsang/UMMAYA/releases',
|
|
62
69
|
BUILD_TIME: process.env.UMMAYA_BUILD_TIME ?? new Date(0).toISOString(),
|
|
@@ -65,7 +72,9 @@ import pkg from '../../package.json' with { type: 'json' }
|
|
|
65
72
|
'Please open a GitHub issue at https://github.com/umyunsang/UMMAYA/issues',
|
|
66
73
|
PACKAGE_URL: 'https://github.com/umyunsang/UMMAYA',
|
|
67
74
|
NATIVE_PACKAGE_URL: 'https://github.com/umyunsang/UMMAYA',
|
|
68
|
-
}
|
|
75
|
+
} satisfies typeof MACRO
|
|
76
|
+
|
|
77
|
+
Reflect.set(globalThis, 'MACRO', runtimeMacro)
|
|
69
78
|
|
|
70
79
|
// ═══════════════════════════════════════════════════════════════════════
|
|
71
80
|
// TTY detection shim
|
|
@@ -147,9 +156,10 @@ if (process.env.UMMAYA_DEBUG_PRELOAD === '1') {
|
|
|
147
156
|
// the documented isTTY exit but a downstream caller is still firing
|
|
148
157
|
// process.exit(1) without a stack trace). Wraps once per process; the
|
|
149
158
|
// original is preserved on `process._origExit`.
|
|
150
|
-
if (!
|
|
151
|
-
|
|
152
|
-
process.
|
|
159
|
+
if (!process._origExit) {
|
|
160
|
+
const originalExit: ProcessExit = process.exit.bind(process)
|
|
161
|
+
process._origExit = originalExit
|
|
162
|
+
const patchedExit: ProcessExit = code => {
|
|
153
163
|
try {
|
|
154
164
|
const stack = new Error('process.exit caller').stack ?? ''
|
|
155
165
|
require('fs').writeSync(
|
|
@@ -159,7 +169,8 @@ if (process.env.UMMAYA_DEBUG_PRELOAD === '1') {
|
|
|
159
169
|
} catch {
|
|
160
170
|
/* stderr torn down */
|
|
161
171
|
}
|
|
162
|
-
return (
|
|
163
|
-
}
|
|
172
|
+
return originalExit(code)
|
|
173
|
+
}
|
|
174
|
+
process.exit = patchedExit
|
|
164
175
|
}
|
|
165
176
|
}
|