ummaya 0.2.4 → 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 +15 -2
- package/bin/ummaya +10 -1
- package/npm-shrinkwrap.json +253 -2
- package/package.json +5 -1
- package/prompts/manifest.yaml +1 -1
- package/prompts/system_v1.md +1 -0
- package/pyproject.toml +26 -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/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 +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 +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/package.json +1 -1
- 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/print.ts +7 -7
- 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 +29 -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 -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/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 +400 -14
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$defs": {"AdapterManifestEntry": {"additionalProperties": false, "description": "One adapter record inside an ``AdapterManifestSyncFrame.entries`` array.\n\nUsed by the TS-side cache to resolve ``tool_id`` and populate the citation\nslot in permission prompts.\n\nValidators:\n- ``policy_authority_url`` required (HTTPS) when ``source_mode`` is ``\"live\"``\n or ``\"mock\"``; ``None`` only allowed when ``source_mode == \"internal\"`` (I4/I5).\n- ``tool_id`` matches ``^[a-z][a-z0-9_]*$`` (I7).", "properties": {"tool_id": {"description": "Globally unique adapter id within the registry, e.g. 'nmc_emergency_search'. Lowercase snake-case; validated by I7.", "minLength": 1, "title": "Tool Id", "type": "string"}, "name": {"description": "Human-readable display name; bilingual permitted.", "maxLength": 80, "minLength": 1, "title": "Name", "type": "string"}, "primitive": {"description": "Primitive verb the adapter is registered under (I6).", "enum": ["find", "send", "check", "locate"], "title": "Primitive", "type": "string"}, "policy_authority_url": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "default": null, "description": "Agency-published policy URL (HTTPS). None only when source_mode == 'internal' (I4/I5).", "title": "Policy Authority Url"}, "source_mode": {"description": "Tag for the citation-rendering surface.", "enum": ["live", "mock", "internal"], "title": "Source Mode", "type": "string"}, "search_hint": {"anyOf": [{"maxLength": 4096, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Bilingual adapter discovery phrase copied from the backend registry. Used by the TUI concrete tool surface and tool-search metadata.", "title": "Search Hint"}, "llm_description": {"anyOf": [{"maxLength": 20000, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Backend-authored model-facing adapter usage prose. This is the same description the backend exposes in OpenAI/FriendliAI function metadata.", "title": "Llm Description"}, "input_schema_json": {"additionalProperties": true, "description": "Full backend Pydantic JSON Schema for adapter input parameters. Credential-only fields such as authKey must be omitted by adapters.", "title": "Input Schema Json", "type": "object"}, "output_schema_json": {"additionalProperties": true, "description": "Full backend Pydantic JSON Schema for adapter output data.", "title": "Output Schema Json", "type": "object"}}, "required": ["tool_id", "name", "primitive", "source_mode"], "title": "AdapterManifestEntry", "type": "object"}, "AdapterManifestSyncFrame": {"additionalProperties": false, "description": "Full registry snapshot emitted by the backend exactly once after boot.\n\n21st arm of the ``IPCFrame`` discriminated union (Epic \u03b5 #2296).\n\nInvariants enforced at construction:\n- I1: ``entries`` is non-empty.\n- I2: No two entries share the same ``tool_id``.\n- I3: ``manifest_hash == sha256(canonical_json(sorted(entries, key=tool_id)))``.\n- I4/I5/I6/I7: delegated to ``AdapterManifestEntry`` validators.\n\nOn invariant violation the Pydantic validator raises ``ValueError``; the\nbackend boot should catch this and exit with ``SystemExit(78)`` per\nConstitution \u00a7 II + Spec 1634 boot-validation pattern.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "adapter_manifest_sync", "default": "adapter_manifest_sync", "description": "Frame discriminator \u2014 21st arm of IPCFrame.", "title": "Kind", "type": "string"}, "entries": {"description": "Full registry snapshot. Non-empty (I1); no duplicate tool_id (I2).", "items": {"$ref": "#/$defs/AdapterManifestEntry"}, "minItems": 1, "title": "Entries", "type": "array"}, "manifest_hash": {"description": "Lowercase hex SHA-256 of canonical-JSON-serialised entries sorted by tool_id (I3). Cheap change-detection for hot-reload (future epic).", "maxLength": 64, "minLength": 64, "title": "Manifest Hash", "type": "string"}, "emitter_pid": {"description": "Python backend PID at boot. Useful for OTEL span cross-correlation.", "exclusiveMinimum": 0, "title": "Emitter Pid", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "entries", "manifest_hash", "emitter_pid"], "title": "AdapterManifestSyncFrame", "type": "object"}, "AssistantChunkFrame": {"additionalProperties": false, "description": "backend -> TUI: streaming assistant text delta.\n\nMirrors Anthropic's ``content_block_delta`` (CC reference at\n``ummaya/llm/_cc_reference/claude.ts:2053-2169``). The ``delta`` field\ncarries the visible answer text (``text_delta`` in CC nomenclature);\n``thinking`` carries the model's chain-of-thought (``thinking_delta``\non the Anthropic side, K-EXAONE's ``delta.reasoning_content`` on the\nOpenAI-compatible FriendliAI feed). Exactly one of ``delta`` /\n``thinking`` carries content per frame \u2014 the empty one is the\nbackward-compatible default. ``done`` terminates the message\nregardless of channel.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "assistant_chunk", "default": "assistant_chunk", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "message_id": {"description": "ULID of the assistant message this delta belongs to.", "title": "Message Id", "type": "string"}, "delta": {"default": "", "description": "UTF-8 text appended to the visible answer (text_delta channel).", "title": "Delta", "type": "string"}, "thinking": {"default": "", "description": "UTF-8 text appended to the model's chain-of-thought (thinking_delta channel \u2014 K-EXAONE delta.reasoning_content).", "title": "Thinking", "type": "string"}, "done": {"description": "True if this is the terminal chunk for this message_id.", "title": "Done", "type": "boolean"}}, "required": ["session_id", "correlation_id", "ts", "role", "message_id", "done"], "title": "AssistantChunkFrame", "type": "object"}, "BackpressureSignalFrame": {"additionalProperties": false, "description": "Emitted when outgoing queue crosses HWM or a 429 condition is detected.\n\nrole allow-list: tui (tui_reader), backend (backend_writer, upstream_429).\nFR-012, FR-015: hud_copy_ko/en MUST be non-empty (min_length=1).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "backpressure", "default": "backpressure", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "signal": {"description": "Reader action. pause=stop emitting; resume=clear; throttle=slow down.", "enum": ["pause", "resume", "throttle"], "title": "Signal", "type": "string"}, "source": {"description": "Origin of the signal.", "enum": ["tui_reader", "backend_writer", "upstream_429"], "title": "Source", "type": "string"}, "queue_depth": {"description": "Current outbound queue size.", "minimum": 0, "title": "Queue Depth", "type": "integer"}, "hwm": {"description": "High-water mark threshold in effect (default 64).", "minimum": 1, "title": "Hwm", "type": "integer"}, "retry_after_ms": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "For throttle sourced from upstream_429; reflects Retry-After. ge=0.", "title": "Retry After Ms"}, "hud_copy_ko": {"description": "Korean HUD copy (civic-facing). Must be non-empty (FR-015).", "minLength": 1, "title": "Hud Copy Ko", "type": "string"}, "hud_copy_en": {"description": "English HUD copy (dev-facing). Must be non-empty (FR-015).", "minLength": 1, "title": "Hud Copy En", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "signal", "source", "queue_depth", "hwm", "hud_copy_ko", "hud_copy_en"], "title": "BackpressureSignalFrame", "type": "object"}, "ChatMessage": {"additionalProperties": false, "description": "One conversation-history entry carried by ``ChatRequestFrame.messages``.\n\n``role=\"tool\"`` messages MUST also set ``name`` (the tool name that was\ninvoked) and ``tool_call_id`` (the originating ``tool_call`` envelope's\ncorrelation id). This is the data-model invariant D4 (tool message\nintegrity) enforced by the ``ChatRequestFrame`` validator below.\n\nLead-Diag-4 (2026-05-04): added optional ``tool_calls`` for ``role='assistant'``\nturns so assistant ``tool_use`` blocks survive the wire round-trip and the\nOpenAI Chat Completions multi-turn pairing invariant (every ``role='tool'``\nmessage MUST follow an assistant message whose ``tool_calls[i].id`` matches\nthe result's ``tool_call_id``) is satisfied. Backward compatible: legacy\nsenders that omit ``tool_calls`` are unaffected.", "properties": {"role": {"description": "Conversation turn author.", "enum": ["system", "user", "assistant", "tool"], "title": "Role", "type": "string"}, "content": {"description": "UTF-8 message body.", "title": "Content", "type": "string"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Tool name when role='tool'; None otherwise.", "title": "Name"}, "tool_call_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Matching ``ToolCallFrame.call_id`` when role='tool'; None otherwise.", "title": "Tool Call Id"}, "tool_calls": {"anyOf": [{"items": {"$ref": "#/$defs/ChatMessageToolCall"}, "type": "array"}, {"type": "null"}], "default": null, "description": "OpenAI Chat Completions assistant-turn tool invocations. Set ONLY on role='assistant' messages that requested one or more tool calls. None for every other role. Each entry's ``id`` is the pairing key that the corresponding role='tool' result message MUST set as its ``tool_call_id``.", "title": "Tool Calls"}}, "required": ["role", "content"], "title": "ChatMessage", "type": "object"}, "ChatMessageFunctionCall": {"additionalProperties": false, "description": "OpenAI-spec ``function`` block carried inside ``ChatMessageToolCall``.\n\nMirrors ``ummaya.llm.models.FunctionCall`` (the LLM-client-internal model)\nbut lives on the *wire* so the TUI can transmit assistant ``tool_use``\nblocks across multi-turn boundaries (Lead-Diag-4, role='tool' wire fix).", "properties": {"name": {"description": "Function/tool name the model requested.", "title": "Name", "type": "string"}, "arguments": {"description": "JSON-serialised string of the function arguments (OpenAI spec).", "title": "Arguments", "type": "string"}}, "required": ["name", "arguments"], "title": "ChatMessageFunctionCall", "type": "object"}, "ChatMessageToolCall": {"additionalProperties": false, "description": "OpenAI-spec ``tool_calls[i]`` entry carried by an assistant ``ChatMessage``.\n\nOpenAI Chat Completions API spec: every ``role='tool'`` message MUST be\npaired (by ``tool_call_id``) with a ``tool_calls[i].id`` from a preceding\nassistant turn. The TUI carries this pairing across the wire so multi-turn\nconversations replay correctly to FriendliAI / OpenAI-compatible providers\n(Lead-Diag-4 fix, 2026-05-04).", "properties": {"id": {"description": "Matching ``ToolCallFrame.call_id`` / ``role='tool'.tool_call_id``.", "title": "Id", "type": "string"}, "type": {"const": "function", "default": "function", "description": "OpenAI tool envelope; only 'function' is currently supported.", "title": "Type", "type": "string"}, "function": {"$ref": "#/$defs/ChatMessageFunctionCall", "description": "Inner function name + JSON-serialised arguments."}}, "required": ["id", "function"], "title": "ChatMessageToolCall", "type": "object"}, "ChatRequestFrame": {"additionalProperties": false, "description": "TUI -> backend: tools-aware chat request (Spec 1978 ADR-0001).\n\nCoexists with ``UserInputFrame`` (which remains the echo / smoke-test path).\nThe backend treats a ``UserInputFrame{text=t}`` as\n``ChatRequestFrame{messages=[{role:'user', content:t}], tools=[]}``.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "chat_request", "default": "chat_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "messages": {"description": "Conversation history; tail message has role 'user' or 'tool'.", "items": {"$ref": "#/$defs/ChatMessage"}, "minItems": 1, "title": "Messages", "type": "array"}, "tools": {"description": "Tools available to the model this turn.", "items": {"$ref": "#/$defs/ToolDefinition"}, "title": "Tools", "type": "array"}, "system": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Effective system prompt (may be None if backend supplies its own).", "title": "System"}, "max_tokens": {"default": 8192, "description": "Maximum tokens for the assistant turn.", "maximum": 32000, "minimum": 1, "title": "Max Tokens", "type": "integer"}, "temperature": {"default": 1.0, "description": "Sampling temperature.", "maximum": 2.0, "minimum": 0.0, "title": "Temperature", "type": "number"}, "top_p": {"default": 0.95, "description": "Nucleus sampling threshold.", "maximum": 1.0, "minimum": 0.0, "title": "Top P", "type": "number"}, "reasoning_mode": {"anyOf": [{"enum": ["fast", "balanced", "deep", "diagnostic", "auto"], "type": "string"}, {"type": "null"}], "default": null, "description": "K-EXAONE/FriendliAI reasoning policy for this assistant turn.", "title": "Reasoning Mode"}}, "required": ["session_id", "correlation_id", "ts", "role", "messages"], "title": "ChatRequestFrame", "type": "object"}, "ConsentRevokeRequestFrame": {"additionalProperties": false, "description": "TUI -> backend: citizen requests revocation of a prior consent receipt.\n\narm 22 of the ``IPCFrame`` discriminated union (Epic 2).\n\nFields:\n- ``request_id``: UUIDv4 string; round-trips in the matching\n ``consent_revoke_response`` frame.\n- ``receipt_id``: The ``rcpt-<id>`` value referencing the receipt file at\n ``~/.ummaya/memdir/user/consent/<receipt_id>.json``.\n- ``scope``: ``\"once\"`` = revoke this single receipt only;\n ``\"session-all\"`` = revoke all receipts for the current session.\n- ``reason``: Optional free-text reason logged to the audit ledger.\n\nrole allow-list: tui.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "consent_revoke_request", "default": "consent_revoke_request", "description": "Frame discriminator \u2014 arm 22 of IPCFrame.", "title": "Kind", "type": "string"}, "request_id": {"description": "UUIDv4 round-trip correlation ID; matched in consent_revoke_response.", "minLength": 1, "title": "Request Id", "type": "string"}, "receipt_id": {"description": "Target receipt identifier (rcpt-<id>). Must match an existing receipt file at ~/.ummaya/memdir/user/consent/<receipt_id>.json.", "minLength": 1, "title": "Receipt Id", "type": "string"}, "scope": {"description": "Revocation scope. 'once' revokes only this receipt; 'session-all' revokes all receipts in the current session.", "enum": ["once", "session-all"], "title": "Scope", "type": "string"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Optional citizen-provided reason logged to the ledger (PIPA \u00a736 citation).", "title": "Reason"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "receipt_id", "scope"], "title": "ConsentRevokeRequestFrame", "type": "object"}, "ConsentRevokeResponseFrame": {"additionalProperties": false, "description": "backend -> TUI: outcome of a consent_revoke_request.\n\narm 23 of the ``IPCFrame`` discriminated union (Epic 2).\n\nFields:\n- ``request_id``: Mirrors the originating consent_revoke_request.request_id.\n- ``ok``: True when at least one receipt was revoked; False on error or\n not-found.\n- ``revoked_at``: ISO-8601 UTC timestamp of the revocation (when ok=True).\n- ``record_hash``: Ledger entry SHA-256 for audit chain verification\n (when ok=True; omitted on error).\n- ``error``: Machine-readable error code on failure (``already_revoked``,\n ``not_found``, ``io_error``); omitted on success.\n\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "consent_revoke_response", "default": "consent_revoke_response", "description": "Frame discriminator \u2014 arm 23 of IPCFrame.", "title": "Kind", "type": "string"}, "request_id": {"description": "Mirrors consent_revoke_request.request_id for round-trip correlation.", "minLength": 1, "title": "Request Id", "type": "string"}, "ok": {"description": "True when at least one receipt was successfully revoked; False on error or not-found.", "title": "Ok", "type": "boolean"}, "revoked_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "ISO-8601 UTC timestamp of revocation. Populated when ok=True.", "title": "Revoked At"}, "record_hash": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Hex SHA-256 of the ledger withdrawal record. Populated when ok=True for audit-chain verification.", "title": "Record Hash"}, "error": {"anyOf": [{"enum": ["already_revoked", "not_found", "io_error"], "type": "string"}, {"type": "null"}], "default": null, "description": "Machine-readable error code when ok=False; None on success.", "title": "Error"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "ok"], "title": "ConsentRevokeResponseFrame", "type": "object"}, "CoordinatorPhaseFrame": {"additionalProperties": false, "description": "backend -> TUI: Spec 027 coordinator phase update.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "coordinator_phase", "default": "coordinator_phase", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "phase": {"description": "Current coordinator phase.", "enum": ["Research", "Synthesis", "Implementation", "Verification"], "title": "Phase", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "phase"], "title": "CoordinatorPhaseFrame", "type": "object"}, "ErrorFrame": {"additionalProperties": false, "description": "backend -> TUI: a backend error surfaced to the TUI for rendering.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "error", "default": "error", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "code": {"description": "Machine-readable error code (e.g., 'backend_crash', 'protocol_mismatch').", "title": "Code", "type": "string"}, "message": {"description": "Human-readable short message. MUST NOT contain UMMAYA_*-prefixed env var values (FR-004 redaction rule).", "title": "Message", "type": "string"}, "details": {"additionalProperties": true, "description": "Structured error details. UMMAYA_* env var values MUST be redacted.", "title": "Details", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "code", "message", "details"], "title": "ErrorFrame", "type": "object"}, "FrameTrailer": {"additionalProperties": false, "description": "Completion/validation metadata on terminal frames (FR-006).", "properties": {"final": {"description": "True when this frame terminates a logical payload/stream.", "title": "Final", "type": "boolean"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Mirror of envelope transaction_id for trailer-only consumers. Non-empty when present (parity with codec.ts trailer schema \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "checksum_sha256": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Hex SHA-256 of the concatenated payload bytes for streamed payloads.", "title": "Checksum Sha256"}}, "required": ["final"], "title": "FrameTrailer", "type": "object"}, "HeartbeatFrame": {"additionalProperties": false, "description": "Emitted every 30 s (default) by both sides to prove liveness.\n\nNote: Heartbeat frames do NOT increment frame_seq \u2014 they use a dedicated\ncounter. This keeps ring-buffer economy tight.\nrole allow-list: tui, backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "heartbeat", "default": "heartbeat", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "direction": {"description": "ping from sender, pong from receiver.", "enum": ["ping", "pong"], "title": "Direction", "type": "string"}, "peer_frame_seq": {"description": "Sender's current outbound frame_seq high-water.", "minimum": 0, "title": "Peer Frame Seq", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "direction", "peer_frame_seq"], "title": "HeartbeatFrame", "type": "object"}, "NotificationPushFrame": {"additionalProperties": false, "description": "Push from app/phone notification surfaces.\n\nCarried over the same stdio channel to keep a single correlation plane.\nrole allow-list: notification.\n\nCC parity: NO equivalent \u2014 Claude Code's notification surface is\nterminal OSC sequences (iTerm2, Kitty, Ghostty, bell) emitted\nin-process from ``ink/useTerminalNotification.ts``. There is no\npush-based IPC notification arm in CC. UMMAYA adds this arm as a\nswap-2 addition for Korean civic push channels (KMA disaster CBS,\ngovernment newsroom alerts, hospital alerts) carried over the\nsame stdio plane to keep a single correlation plane. Spec 2642\nEpic F \u00b7 S7 audit recorded this finding (specs/cc-migration-audit/\nscope-S7-ipc-bridge.md \u00a7 5 Finding 3 \u2014 resolved as orthogonal\nUMMAYA swap-2 add-on, not a CC-divergence regression).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "notification_push", "default": "notification_push", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "subscription_id": {"description": "Notification channel handle.", "title": "Subscription Id", "type": "string"}, "adapter_id": {"description": "e.g., disaster_alert_cbs_push, gov_newsroom_push.", "title": "Adapter Id", "type": "string"}, "event_guid": {"description": "RSS guid or CBS event hash for duplicate suppression.", "title": "Event Guid", "type": "string"}, "payload_content_type": {"description": "Inline payload MIME.", "enum": ["text/plain", "application/json"], "title": "Payload Content Type", "type": "string"}, "payload": {"description": "Inline notification content (Korean for civic users).", "title": "Payload", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "subscription_id", "adapter_id", "event_guid", "payload_content_type", "payload"], "title": "NotificationPushFrame", "type": "object"}, "PayloadDeltaFrame": {"additionalProperties": false, "description": "One chunk of a streamed payload.\n\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_delta", "default": "payload_delta", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "delta_seq": {"description": "Monotonic within the payload (first delta = 0).", "minimum": 0, "title": "Delta Seq", "type": "integer"}, "payload": {"description": "UTF-8 text. If content-type is application/json, this is a JSON-encoded fragment string.", "title": "Payload", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "delta_seq", "payload"], "title": "PayloadDeltaFrame", "type": "object"}, "PayloadEndFrame": {"additionalProperties": false, "description": "Terminates a streamed payload.\n\nMUST carry a trailer with final=True.\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_end", "default": "payload_end", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "delta_count": {"description": "Total number of payload_delta frames emitted.", "minimum": 0, "title": "Delta Count", "type": "integer"}, "status": {"description": "Terminal disposition.", "enum": ["ok", "aborted"], "title": "Status", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "delta_count", "status"], "title": "PayloadEndFrame", "type": "object"}, "PayloadStartFrame": {"additionalProperties": false, "description": "Begins a streamed payload (assistant output, tool result chunking).\n\nSender MUST follow with >= 1 payload_delta and exactly one payload_end.\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_start", "default": "payload_start", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "content_type": {"description": "Payload MIME type.", "enum": ["text/markdown", "application/json", "text/plain"], "title": "Content Type", "type": "string"}, "estimated_bytes": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "Optional size hint for HUD progress bars.", "title": "Estimated Bytes"}}, "required": ["session_id", "correlation_id", "ts", "role", "content_type"], "title": "PayloadStartFrame", "type": "object"}, "PermissionRequestFrame": {"additionalProperties": false, "description": "backend -> TUI: a worker raises a permission request.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "permission_request", "default": "permission_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "request_id": {"description": "ULID; round-trips in the matching permission_response frame.", "title": "Request Id", "type": "string"}, "worker_id": {"description": "Worker requesting permission.", "title": "Worker Id", "type": "string"}, "primitive_kind": {"description": "The primitive the worker wants to invoke.", "enum": ["find", "locate", "send", "check"], "title": "Primitive Kind", "type": "string"}, "description_ko": {"description": "Korean-language description shown to the citizen.", "title": "Description Ko", "type": "string"}, "description_en": {"description": "English-language description shown alongside the Korean one.", "title": "Description En", "type": "string"}, "risk_level": {"description": "Risk classification of the requested operation.", "enum": ["low", "medium", "high"], "title": "Risk Level", "type": "string"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Fully-qualified adapter id (e.g. `mock_verify_mobile_id`). Falls back to worker_id || primitive_kind in the TUI when None. None for legacy callers that have not yet been updated.", "title": "Tool Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "worker_id", "primitive_kind", "description_ko", "description_en", "risk_level"], "title": "PermissionRequestFrame", "type": "object"}, "PermissionResponseFrame": {"additionalProperties": false, "description": "TUI -> backend: citizen's decision on a permission_request.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "permission_response", "default": "permission_response", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "request_id": {"description": "ULID matching the originating permission_request.request_id.", "title": "Request Id", "type": "string"}, "decision": {"description": "Citizen's permission decision.", "enum": ["granted", "allow_once", "allow_session", "denied", "deny"], "title": "Decision", "type": "string"}, "receipt_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Consent receipt UUID written to ~/.ummaya/memdir/user/consent/<id>.json on granted decisions. None on deny / timeout.", "title": "Receipt Id"}, "primitive_kind": {"anyOf": [{"enum": ["find", "locate", "send", "check"], "type": "string"}, {"type": "null"}], "default": null, "description": "The primitive that was authorised. The TUI feeds this into `aalToLayer(primitive, isIrreversible)` to recompute the gauntlet layer (1=green / 2=orange / 3=red) for the receipt row. None on deny / timeout / legacy backends.", "title": "Primitive Kind"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "The fully-qualified adapter id (e.g. `mock_verify_mobile_id`, `mock_submit_welfare_grant`) the citizen authorised. The TUI uses this to render the human-readable Korean adapter name in /consent list and the modal title. None for non-adapter primitives (rare) or legacy backends.", "title": "Tool Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "decision"], "title": "PermissionResponseFrame", "type": "object"}, "PluginOpFrame": {"additionalProperties": false, "description": "Plugin install / uninstall / list control-plane frame.\n\nSingle arm carrying the three operation states discriminated by the\ninner ``op`` field. Modelled as one ``kind`` so the IPC discriminator\nkeeps ``plugin_op`` as a single 20th arm \u2014 matching the migration\ntree's \"20th arm\" decision while preserving the per-phase shape\ndocumented in ``contracts/plugin-install.cli.md``.\n\nOp-specific shape rules (enforced by ``_v_plugin_op_shape``):\n\n* ``op=\"request\"``: ``name`` required when ``request_op`` is\n ``\"install\"`` or ``\"uninstall\"``; ``progress_phase`` /\n ``progress_message_ko`` / ``progress_message_en`` / ``result`` /\n ``exit_code`` MUST be ``None``.\n* ``op=\"progress\"``: ``progress_phase`` (1-7), ``progress_message_ko``,\n ``progress_message_en`` required; install-request fields must be\n ``None``.\n* ``op=\"complete\"``: ``result`` + ``exit_code`` required; everything\n else None except optional ``receipt_id``.\n\nrole allow-list: tui (request), backend (progress / complete).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "plugin_op", "default": "plugin_op", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "op": {"description": "Operation phase. ``request`` = TUI initiates install/uninstall/list; ``progress`` = backend reports phase tick; ``complete`` = backend reports terminal outcome.", "enum": ["request", "progress", "complete"], "title": "Op", "type": "string"}, "request_op": {"anyOf": [{"enum": ["install", "uninstall", "list"], "type": "string"}, {"type": "null"}], "default": null, "description": "Sub-action when op='request'. Required for op='request'; None otherwise.", "title": "Request Op"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Plugin catalog name (matches CatalogEntry.name). Required when request_op in {install, uninstall}; None otherwise.", "title": "Name"}, "requested_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Optional SemVer pin for op='request'/install. Renamed from `version` to avoid shadowing the envelope's protocol version.", "title": "Requested Version"}, "dry_run": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "default": null, "description": "When True, install verifies but writes nothing (op='request').", "title": "Dry Run"}, "progress_phase": {"anyOf": [{"type": "integer"}, {"type": "null"}], "default": null, "description": "Install phase index 1-7 per contracts/plugin-install.cli.md. Required when op='progress'.", "title": "Progress Phase"}, "progress_message_ko": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Korean-primary progress message shown in the Ink overlay.", "title": "Progress Message Ko"}, "progress_message_en": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "English fallback progress message.", "title": "Progress Message En"}, "result": {"anyOf": [{"enum": ["success", "failure"], "type": "string"}, {"type": "null"}], "default": null, "description": "Terminal outcome. Required when op='complete'.", "title": "Result"}, "exit_code": {"anyOf": [{"type": "integer"}, {"type": "null"}], "default": null, "description": "Process exit code per contracts/plugin-install.cli.md exit-code table. Required when op='complete'.", "title": "Exit Code"}, "receipt_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Spec 035 consent receipt id when op='complete' AND result='success'.", "title": "Receipt Id"}, "error_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Machine-readable failure kind (e.g. 'bundle_sha_mismatch', 'slsa_skip_in_production') when op='complete' AND result='failure'. Used by the TUI to map exit codes to citizen-friendly Korean messages.", "title": "Error Kind"}, "error_message": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Developer-facing English error detail when op='complete' AND result='failure'.", "title": "Error Message"}, "was_idempotent_noop": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "default": null, "description": "True when op='complete' + result='success' but the operation was a no-op because the plugin was already in the target state (e.g. uninstall of a plugin that was never installed). TUI uses this to show '\uc774\ubbf8 \uc81c\uac70\ub428' instead of '\uc81c\uac70 \uc644\ub8cc'.", "title": "Was Idempotent Noop"}}, "required": ["session_id", "correlation_id", "ts", "role", "op"], "title": "PluginOpFrame", "type": "object"}, "ProgressEventFrame": {"additionalProperties": false, "description": "backend -> TUI: deterministic query-loop progress.\n\nThis is intentionally separate from ``AssistantChunkFrame.thinking``.\n``progress_event`` carries safe harness state such as analysis, tool\nselection, tool dispatch/result, and answer synthesis. Provider reasoning\nremains on the gated ``thinking_delta`` channel.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "progress_event", "default": "progress_event", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "phase": {"description": "Safe query-loop phase represented by this event.", "enum": ["analysis", "tool_selection", "tool_call", "tool_result", "answer_synthesis"], "title": "Phase", "type": "string"}, "message_ko": {"description": "Korean progress text for the TUI.", "minLength": 1, "title": "Message Ko", "type": "string"}, "message_en": {"description": "English fallback progress text.", "minLength": 1, "title": "Message En", "type": "string"}, "safe_to_persist": {"default": true, "description": "True because this channel never carries raw provider chain-of-thought.", "title": "Safe To Persist", "type": "boolean"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Concrete adapter/tool id when this event is tied to one.", "title": "Tool Id"}, "call_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Tool call id when this event is tied to a specific invocation.", "title": "Call Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "phase", "message_ko", "message_en"], "title": "ProgressEventFrame", "type": "object"}, "ResumeRejectedFrame": {"additionalProperties": false, "description": "Backend cannot honor the resume request.\n\nTrailer with final=True MUST be set (E6).\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_rejected", "default": "resume_rejected", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "reason": {"description": "Machine-readable reason code.", "enum": ["ring_evicted", "session_unknown", "token_mismatch", "protocol_incompatible", "session_expired"], "title": "Reason", "type": "string"}, "detail": {"description": "Human-readable Korean/English detail for HUD.", "title": "Detail", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "reason", "detail"], "title": "ResumeRejectedFrame", "type": "object"}, "ResumeRequestFrame": {"additionalProperties": false, "description": "Sent by the reconnecting TUI after a stdio drop.\n\nrole allow-list: tui.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_request", "default": "resume_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "last_seen_correlation_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Last correlation_id the TUI successfully applied. None if no prior frame.", "title": "Last Seen Correlation Id"}, "last_seen_frame_seq": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "Last frame_seq applied. None if none.", "title": "Last Seen Frame Seq"}, "tui_session_token": {"description": "TUI-local session token for authenticity binding.", "minLength": 1, "title": "Tui Session Token", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "tui_session_token"], "title": "ResumeRequestFrame", "type": "object"}, "ResumeResponseFrame": {"additionalProperties": false, "description": "Backend accepts the resume.\n\nMust be followed by replay of frames with frame_seq > last_seen_frame_seq.\nTrailer with final=True MUST be set (E6).\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_response", "default": "resume_response", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "resumed_from_frame_seq": {"description": "Inclusive lower bound of frames that will be replayed.", "minimum": 0, "title": "Resumed From Frame Seq", "type": "integer"}, "replay_count": {"description": "Total frames the backend will replay. Bounded by ring buffer size.", "minimum": 0, "title": "Replay Count", "type": "integer"}, "server_session_id": {"description": "Backend-assigned session id the TUI should use going forward.", "title": "Server Session Id", "type": "string"}, "heartbeat_interval_ms": {"description": "Negotiated heartbeat cadence (default 30000).", "minimum": 1000, "title": "Heartbeat Interval Ms", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "resumed_from_frame_seq", "replay_count", "server_session_id", "heartbeat_interval_ms"], "title": "ResumeResponseFrame", "type": "object"}, "SessionEventFrame": {"additionalProperties": false, "description": "Bidirectional: session lifecycle events.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "session_event", "default": "session_event", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "event": {"description": "Session lifecycle event type.", "enum": ["save", "load", "list", "resume", "new", "exit"], "title": "Event", "type": "string"}, "payload": {"additionalProperties": true, "description": "Event-specific payload. For list: {sessions: [{id, created_at, turn_count}]}. For resume: {id: str}. For others: {}.", "title": "Payload", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "event", "payload"], "title": "SessionEventFrame", "type": "object"}, "ToolCallFrame": {"additionalProperties": false, "description": "backend -> TUI (display only): a tool invocation decision by the model.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "tool_call", "default": "tool_call", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "call_id": {"description": "ULID correlating this call to its subsequent tool_result.", "title": "Call Id", "type": "string"}, "name": {"description": "Concrete tool name selected by the model; root primitive names remain valid for legacy transcripts.", "minLength": 1, "title": "Name", "type": "string"}, "arguments": {"additionalProperties": true, "description": "Tool-specific arguments. Concrete adapter calls carry adapter schema fields directly.", "title": "Arguments", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "call_id", "name", "arguments"], "title": "ToolCallFrame", "type": "object"}, "ToolDefinition": {"additionalProperties": false, "description": "OpenAI-style tool definition (function-calling).", "properties": {"type": {"const": "function", "default": "function", "description": "OpenAI tool envelope; only 'function' is currently supported.", "title": "Type", "type": "string"}, "function": {"$ref": "#/$defs/ToolDefinitionFunction", "description": "Inner function metadata."}}, "required": ["function"], "title": "ToolDefinition", "type": "object"}, "ToolDefinitionFunction": {"additionalProperties": false, "description": "Inner ``function`` block of an OpenAI-style tool definition.", "properties": {"name": {"description": "Tool name (matches the primitive registry id).", "title": "Name", "type": "string"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Human-readable description shown to the model for tool selection.", "title": "Description"}, "parameters": {"additionalProperties": true, "description": "JSON Schema (Draft 2020-12) for the tool input. Pydantic accepts any dict shape; deeper schema validation is delegated to LLMClient.", "title": "Parameters", "type": "object"}}, "required": ["name"], "title": "ToolDefinitionFunction", "type": "object"}, "ToolResultEnvelope": {"additionalProperties": true, "description": "Active primitive discriminated union envelope (open schema).", "properties": {"kind": {"description": "Primitive kind discriminator per Spec 031.", "enum": ["find", "locate", "send", "check"], "title": "Kind", "type": "string"}}, "required": ["kind"], "title": "ToolResultEnvelope", "type": "object"}, "ToolResultFrame": {"additionalProperties": false, "description": "backend -> TUI (render): the output of a tool invocation.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "tool_result", "default": "tool_result", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "call_id": {"description": "ULID correlating this result to its originating tool_call.", "title": "Call Id", "type": "string"}, "envelope": {"$ref": "#/$defs/ToolResultEnvelope", "description": "Active primitive discriminated union. Unknown kind falls to UnrecognizedPayload."}}, "required": ["session_id", "correlation_id", "ts", "role", "call_id", "envelope"], "title": "ToolResultFrame", "type": "object"}, "UserInputFrame": {"additionalProperties": false, "description": "TUI -> backend: a citizen's typed input.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "user_input", "default": "user_input", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "text": {"description": "Raw user text in UTF-8 (may contain Korean, English, emoji).", "title": "Text", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "text"], "title": "UserInputFrame", "type": "object"}, "WorkerStatusFrame": {"additionalProperties": false, "description": "backend -> TUI: per-worker status row update from Spec 027 swarm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "worker_status", "default": "worker_status", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "worker_id": {"description": "Unique worker identifier.", "title": "Worker Id", "type": "string"}, "role_id": {"description": "Specialist label (e.g., transport-specialist, health-specialist).", "title": "Role Id", "type": "string"}, "current_primitive": {"description": "Primitive currently being invoked by this worker.", "enum": ["find", "locate", "send", "check"], "title": "Current Primitive", "type": "string"}, "status": {"description": "Worker execution status.", "enum": ["idle", "running", "waiting_permission", "error"], "title": "Status", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "worker_id", "role_id", "current_primitive", "status"], "title": "WorkerStatusFrame", "type": "object"}}, "discriminator": {"mapping": {"adapter_manifest_sync": "#/$defs/AdapterManifestSyncFrame", "assistant_chunk": "#/$defs/AssistantChunkFrame", "backpressure": "#/$defs/BackpressureSignalFrame", "chat_request": "#/$defs/ChatRequestFrame", "consent_revoke_request": "#/$defs/ConsentRevokeRequestFrame", "consent_revoke_response": "#/$defs/ConsentRevokeResponseFrame", "coordinator_phase": "#/$defs/CoordinatorPhaseFrame", "error": "#/$defs/ErrorFrame", "heartbeat": "#/$defs/HeartbeatFrame", "notification_push": "#/$defs/NotificationPushFrame", "payload_delta": "#/$defs/PayloadDeltaFrame", "payload_end": "#/$defs/PayloadEndFrame", "payload_start": "#/$defs/PayloadStartFrame", "permission_request": "#/$defs/PermissionRequestFrame", "permission_response": "#/$defs/PermissionResponseFrame", "plugin_op": "#/$defs/PluginOpFrame", "progress_event": "#/$defs/ProgressEventFrame", "resume_rejected": "#/$defs/ResumeRejectedFrame", "resume_request": "#/$defs/ResumeRequestFrame", "resume_response": "#/$defs/ResumeResponseFrame", "session_event": "#/$defs/SessionEventFrame", "tool_call": "#/$defs/ToolCallFrame", "tool_result": "#/$defs/ToolResultFrame", "user_input": "#/$defs/UserInputFrame", "worker_status": "#/$defs/WorkerStatusFrame"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/$defs/UserInputFrame"}, {"$ref": "#/$defs/ChatRequestFrame"}, {"$ref": "#/$defs/AssistantChunkFrame"}, {"$ref": "#/$defs/ProgressEventFrame"}, {"$ref": "#/$defs/ToolCallFrame"}, {"$ref": "#/$defs/ToolResultFrame"}, {"$ref": "#/$defs/CoordinatorPhaseFrame"}, {"$ref": "#/$defs/WorkerStatusFrame"}, {"$ref": "#/$defs/PermissionRequestFrame"}, {"$ref": "#/$defs/PermissionResponseFrame"}, {"$ref": "#/$defs/SessionEventFrame"}, {"$ref": "#/$defs/ErrorFrame"}, {"$ref": "#/$defs/PayloadStartFrame"}, {"$ref": "#/$defs/PayloadDeltaFrame"}, {"$ref": "#/$defs/PayloadEndFrame"}, {"$ref": "#/$defs/BackpressureSignalFrame"}, {"$ref": "#/$defs/ResumeRequestFrame"}, {"$ref": "#/$defs/ResumeResponseFrame"}, {"$ref": "#/$defs/ResumeRejectedFrame"}, {"$ref": "#/$defs/HeartbeatFrame"}, {"$ref": "#/$defs/NotificationPushFrame"}, {"$ref": "#/$defs/PluginOpFrame"}, {"$ref": "#/$defs/AdapterManifestSyncFrame"}, {"$ref": "#/$defs/ConsentRevokeRequestFrame"}, {"$ref": "#/$defs/ConsentRevokeResponseFrame"}]}
|
|
1
|
+
{"$defs": {"AdapterManifestEntry": {"additionalProperties": false, "description": "One adapter record inside an ``AdapterManifestSyncFrame.entries`` array.\n\nUsed by the TS-side cache to resolve ``tool_id`` and populate the citation\nslot in permission prompts.\n\nValidators:\n- ``policy_authority_url`` required (HTTPS) when ``source_mode`` is ``\"live\"``\n or ``\"mock\"``; ``None`` only allowed when ``source_mode == \"internal\"`` (I4/I5).\n- ``tool_id`` matches ``^[a-z][a-z0-9_]*$`` (I7).", "properties": {"tool_id": {"description": "Globally unique adapter id within the registry, e.g. 'nmc_emergency_search'. Lowercase snake-case; validated by I7.", "minLength": 1, "title": "Tool Id", "type": "string"}, "name": {"description": "Human-readable display name; bilingual permitted.", "maxLength": 80, "minLength": 1, "title": "Name", "type": "string"}, "primitive": {"description": "Primitive verb the adapter is registered under (I6).", "enum": ["find", "send", "check", "locate", "document"], "title": "Primitive", "type": "string"}, "policy_authority_url": {"anyOf": [{"maxLength": 2048, "type": "string"}, {"type": "null"}], "default": null, "description": "Agency-published policy URL (HTTPS). None only when source_mode == 'internal' (I4/I5).", "title": "Policy Authority Url"}, "source_mode": {"description": "Tag for the citation-rendering surface.", "enum": ["live", "mock", "internal"], "title": "Source Mode", "type": "string"}, "search_hint": {"anyOf": [{"maxLength": 4096, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Bilingual adapter discovery phrase copied from the backend registry. Used by the TUI concrete tool surface and tool-search metadata.", "title": "Search Hint"}, "llm_description": {"anyOf": [{"maxLength": 20000, "minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Backend-authored model-facing adapter usage prose. This is the same description the backend exposes in OpenAI/FriendliAI function metadata.", "title": "Llm Description"}, "input_schema_json": {"additionalProperties": true, "description": "Full backend Pydantic JSON Schema for adapter input parameters. Credential-only fields such as authKey must be omitted by adapters.", "title": "Input Schema Json", "type": "object"}, "output_schema_json": {"additionalProperties": true, "description": "Full backend Pydantic JSON Schema for adapter output data.", "title": "Output Schema Json", "type": "object"}}, "required": ["tool_id", "name", "primitive", "source_mode"], "title": "AdapterManifestEntry", "type": "object"}, "AdapterManifestSyncFrame": {"additionalProperties": false, "description": "Full registry snapshot emitted by the backend exactly once after boot.\n\n21st arm of the ``IPCFrame`` discriminated union (Epic \u03b5 #2296).\n\nInvariants enforced at construction:\n- I1: ``entries`` is non-empty.\n- I2: No two entries share the same ``tool_id``.\n- I3: ``manifest_hash == sha256(canonical_json(sorted(entries, key=tool_id)))``.\n- I4/I5/I6/I7: delegated to ``AdapterManifestEntry`` validators.\n\nOn invariant violation the Pydantic validator raises ``ValueError``; the\nbackend boot should catch this and exit with ``SystemExit(78)`` per\nConstitution \u00a7 II + Spec 1634 boot-validation pattern.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "adapter_manifest_sync", "default": "adapter_manifest_sync", "description": "Frame discriminator \u2014 21st arm of IPCFrame.", "title": "Kind", "type": "string"}, "entries": {"description": "Full registry snapshot. Non-empty (I1); no duplicate tool_id (I2).", "items": {"$ref": "#/$defs/AdapterManifestEntry"}, "minItems": 1, "title": "Entries", "type": "array"}, "manifest_hash": {"description": "Lowercase hex SHA-256 of canonical-JSON-serialised entries sorted by tool_id (I3). Cheap change-detection for hot-reload (future epic).", "maxLength": 64, "minLength": 64, "title": "Manifest Hash", "type": "string"}, "emitter_pid": {"description": "Python backend PID at boot. Useful for OTEL span cross-correlation.", "exclusiveMinimum": 0, "title": "Emitter Pid", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "entries", "manifest_hash", "emitter_pid"], "title": "AdapterManifestSyncFrame", "type": "object"}, "AssistantChunkFrame": {"additionalProperties": false, "description": "backend -> TUI: streaming assistant text delta.\n\nMirrors Anthropic's ``content_block_delta`` (CC reference at\n``ummaya/llm/_cc_reference/claude.ts:2053-2169``). The ``delta`` field\ncarries the visible answer text (``text_delta`` in CC nomenclature);\n``thinking`` carries the model's chain-of-thought (``thinking_delta``\non the Anthropic side, K-EXAONE's ``delta.reasoning_content`` on the\nOpenAI-compatible FriendliAI feed). Exactly one of ``delta`` /\n``thinking`` carries content per frame \u2014 the empty one is the\nbackward-compatible default. ``done`` terminates the message\nregardless of channel.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "assistant_chunk", "default": "assistant_chunk", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "message_id": {"description": "ULID of the assistant message this delta belongs to.", "title": "Message Id", "type": "string"}, "delta": {"default": "", "description": "UTF-8 text appended to the visible answer (text_delta channel).", "title": "Delta", "type": "string"}, "thinking": {"default": "", "description": "UTF-8 text appended to the model's chain-of-thought (thinking_delta channel \u2014 K-EXAONE delta.reasoning_content).", "title": "Thinking", "type": "string"}, "done": {"description": "True if this is the terminal chunk for this message_id.", "title": "Done", "type": "boolean"}}, "required": ["session_id", "correlation_id", "ts", "role", "message_id", "done"], "title": "AssistantChunkFrame", "type": "object"}, "BackpressureSignalFrame": {"additionalProperties": false, "description": "Emitted when outgoing queue crosses HWM or a 429 condition is detected.\n\nrole allow-list: tui (tui_reader), backend (backend_writer, upstream_429).\nFR-012, FR-015: hud_copy_ko/en MUST be non-empty (min_length=1).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "backpressure", "default": "backpressure", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "signal": {"description": "Reader action. pause=stop emitting; resume=clear; throttle=slow down.", "enum": ["pause", "resume", "throttle"], "title": "Signal", "type": "string"}, "source": {"description": "Origin of the signal.", "enum": ["tui_reader", "backend_writer", "upstream_429"], "title": "Source", "type": "string"}, "queue_depth": {"description": "Current outbound queue size.", "minimum": 0, "title": "Queue Depth", "type": "integer"}, "hwm": {"description": "High-water mark threshold in effect (default 64).", "minimum": 1, "title": "Hwm", "type": "integer"}, "retry_after_ms": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "For throttle sourced from upstream_429; reflects Retry-After. ge=0.", "title": "Retry After Ms"}, "hud_copy_ko": {"description": "Korean HUD copy (civic-facing). Must be non-empty (FR-015).", "minLength": 1, "title": "Hud Copy Ko", "type": "string"}, "hud_copy_en": {"description": "English HUD copy (dev-facing). Must be non-empty (FR-015).", "minLength": 1, "title": "Hud Copy En", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "signal", "source", "queue_depth", "hwm", "hud_copy_ko", "hud_copy_en"], "title": "BackpressureSignalFrame", "type": "object"}, "ChatMessage": {"additionalProperties": false, "description": "One conversation-history entry carried by ``ChatRequestFrame.messages``.\n\n``role=\"tool\"`` messages MUST also set ``name`` (the tool name that was\ninvoked) and ``tool_call_id`` (the originating ``tool_call`` envelope's\ncorrelation id). This is the data-model invariant D4 (tool message\nintegrity) enforced by the ``ChatRequestFrame`` validator below.\n\nLead-Diag-4 (2026-05-04): added optional ``tool_calls`` for ``role='assistant'``\nturns so assistant ``tool_use`` blocks survive the wire round-trip and the\nOpenAI Chat Completions multi-turn pairing invariant (every ``role='tool'``\nmessage MUST follow an assistant message whose ``tool_calls[i].id`` matches\nthe result's ``tool_call_id``) is satisfied. Backward compatible: legacy\nsenders that omit ``tool_calls`` are unaffected.", "properties": {"role": {"description": "Conversation turn author.", "enum": ["system", "user", "assistant", "tool"], "title": "Role", "type": "string"}, "content": {"description": "UTF-8 message body.", "title": "Content", "type": "string"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Tool name when role='tool'; None otherwise.", "title": "Name"}, "tool_call_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Matching ``ToolCallFrame.call_id`` when role='tool'; None otherwise.", "title": "Tool Call Id"}, "tool_calls": {"anyOf": [{"items": {"$ref": "#/$defs/ChatMessageToolCall"}, "type": "array"}, {"type": "null"}], "default": null, "description": "OpenAI Chat Completions assistant-turn tool invocations. Set ONLY on role='assistant' messages that requested one or more tool calls. None for every other role. Each entry's ``id`` is the pairing key that the corresponding role='tool' result message MUST set as its ``tool_call_id``.", "title": "Tool Calls"}}, "required": ["role", "content"], "title": "ChatMessage", "type": "object"}, "ChatMessageFunctionCall": {"additionalProperties": false, "description": "OpenAI-spec ``function`` block carried inside ``ChatMessageToolCall``.\n\nMirrors ``ummaya.llm.models.FunctionCall`` (the LLM-client-internal model)\nbut lives on the *wire* so the TUI can transmit assistant ``tool_use``\nblocks across multi-turn boundaries (Lead-Diag-4, role='tool' wire fix).", "properties": {"name": {"description": "Function/tool name the model requested.", "title": "Name", "type": "string"}, "arguments": {"description": "JSON-serialised string of the function arguments (OpenAI spec).", "title": "Arguments", "type": "string"}}, "required": ["name", "arguments"], "title": "ChatMessageFunctionCall", "type": "object"}, "ChatMessageToolCall": {"additionalProperties": false, "description": "OpenAI-spec ``tool_calls[i]`` entry carried by an assistant ``ChatMessage``.\n\nOpenAI Chat Completions API spec: every ``role='tool'`` message MUST be\npaired (by ``tool_call_id``) with a ``tool_calls[i].id`` from a preceding\nassistant turn. The TUI carries this pairing across the wire so multi-turn\nconversations replay correctly to FriendliAI / OpenAI-compatible providers\n(Lead-Diag-4 fix, 2026-05-04).", "properties": {"id": {"description": "Matching ``ToolCallFrame.call_id`` / ``role='tool'.tool_call_id``.", "title": "Id", "type": "string"}, "type": {"const": "function", "default": "function", "description": "OpenAI tool envelope; only 'function' is currently supported.", "title": "Type", "type": "string"}, "function": {"$ref": "#/$defs/ChatMessageFunctionCall", "description": "Inner function name + JSON-serialised arguments."}}, "required": ["id", "function"], "title": "ChatMessageToolCall", "type": "object"}, "ChatRequestFrame": {"additionalProperties": false, "description": "TUI -> backend: tools-aware chat request (Spec 1978 ADR-0001).\n\nCoexists with ``UserInputFrame`` (which remains the echo / smoke-test path).\nThe backend treats a ``UserInputFrame{text=t}`` as\n``ChatRequestFrame{messages=[{role:'user', content:t}], tools=[]}``.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "chat_request", "default": "chat_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "messages": {"description": "Conversation history; tail message has role 'user' or 'tool'.", "items": {"$ref": "#/$defs/ChatMessage"}, "minItems": 1, "title": "Messages", "type": "array"}, "tools": {"description": "Tools available to the model this turn.", "items": {"$ref": "#/$defs/ToolDefinition"}, "title": "Tools", "type": "array"}, "system": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Effective system prompt (may be None if backend supplies its own).", "title": "System"}, "max_tokens": {"default": 8192, "description": "Maximum tokens for the assistant turn.", "maximum": 32000, "minimum": 1, "title": "Max Tokens", "type": "integer"}, "temperature": {"default": 1.0, "description": "Sampling temperature.", "maximum": 2.0, "minimum": 0.0, "title": "Temperature", "type": "number"}, "top_p": {"default": 0.95, "description": "Nucleus sampling threshold.", "maximum": 1.0, "minimum": 0.0, "title": "Top P", "type": "number"}, "reasoning_mode": {"anyOf": [{"enum": ["fast", "balanced", "deep", "diagnostic", "auto"], "type": "string"}, {"type": "null"}], "default": null, "description": "K-EXAONE/FriendliAI reasoning policy for this assistant turn.", "title": "Reasoning Mode"}}, "required": ["session_id", "correlation_id", "ts", "role", "messages"], "title": "ChatRequestFrame", "type": "object"}, "ConsentRevokeRequestFrame": {"additionalProperties": false, "description": "TUI -> backend: citizen requests revocation of a prior consent receipt.\n\narm 22 of the ``IPCFrame`` discriminated union (Epic 2).\n\nFields:\n- ``request_id``: UUIDv4 string; round-trips in the matching\n ``consent_revoke_response`` frame.\n- ``receipt_id``: The ``rcpt-<id>`` value referencing the receipt file at\n ``~/.ummaya/memdir/user/consent/<receipt_id>.json``.\n- ``scope``: ``\"once\"`` = revoke this single receipt only;\n ``\"session-all\"`` = revoke all receipts for the current session.\n- ``reason``: Optional free-text reason logged to the audit ledger.\n\nrole allow-list: tui.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "consent_revoke_request", "default": "consent_revoke_request", "description": "Frame discriminator \u2014 arm 22 of IPCFrame.", "title": "Kind", "type": "string"}, "request_id": {"description": "UUIDv4 round-trip correlation ID; matched in consent_revoke_response.", "minLength": 1, "title": "Request Id", "type": "string"}, "receipt_id": {"description": "Target receipt identifier (rcpt-<id>). Must match an existing receipt file at ~/.ummaya/memdir/user/consent/<receipt_id>.json.", "minLength": 1, "title": "Receipt Id", "type": "string"}, "scope": {"description": "Revocation scope. 'once' revokes only this receipt; 'session-all' revokes all receipts in the current session.", "enum": ["once", "session-all"], "title": "Scope", "type": "string"}, "reason": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Optional citizen-provided reason logged to the ledger (PIPA \u00a736 citation).", "title": "Reason"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "receipt_id", "scope"], "title": "ConsentRevokeRequestFrame", "type": "object"}, "ConsentRevokeResponseFrame": {"additionalProperties": false, "description": "backend -> TUI: outcome of a consent_revoke_request.\n\narm 23 of the ``IPCFrame`` discriminated union (Epic 2).\n\nFields:\n- ``request_id``: Mirrors the originating consent_revoke_request.request_id.\n- ``ok``: True when at least one receipt was revoked; False on error or\n not-found.\n- ``revoked_at``: ISO-8601 UTC timestamp of the revocation (when ok=True).\n- ``record_hash``: Ledger entry SHA-256 for audit chain verification\n (when ok=True; omitted on error).\n- ``error``: Machine-readable error code on failure (``already_revoked``,\n ``not_found``, ``io_error``); omitted on success.\n\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "consent_revoke_response", "default": "consent_revoke_response", "description": "Frame discriminator \u2014 arm 23 of IPCFrame.", "title": "Kind", "type": "string"}, "request_id": {"description": "Mirrors consent_revoke_request.request_id for round-trip correlation.", "minLength": 1, "title": "Request Id", "type": "string"}, "ok": {"description": "True when at least one receipt was successfully revoked; False on error or not-found.", "title": "Ok", "type": "boolean"}, "revoked_at": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "ISO-8601 UTC timestamp of revocation. Populated when ok=True.", "title": "Revoked At"}, "record_hash": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Hex SHA-256 of the ledger withdrawal record. Populated when ok=True for audit-chain verification.", "title": "Record Hash"}, "error": {"anyOf": [{"enum": ["already_revoked", "not_found", "io_error"], "type": "string"}, {"type": "null"}], "default": null, "description": "Machine-readable error code when ok=False; None on success.", "title": "Error"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "ok"], "title": "ConsentRevokeResponseFrame", "type": "object"}, "CoordinatorPhaseFrame": {"additionalProperties": false, "description": "backend -> TUI: Spec 027 coordinator phase update.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "coordinator_phase", "default": "coordinator_phase", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "phase": {"description": "Current coordinator phase.", "enum": ["Research", "Synthesis", "Implementation", "Verification"], "title": "Phase", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "phase"], "title": "CoordinatorPhaseFrame", "type": "object"}, "ErrorFrame": {"additionalProperties": false, "description": "backend -> TUI: a backend error surfaced to the TUI for rendering.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "error", "default": "error", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "code": {"description": "Machine-readable error code (e.g., 'backend_crash', 'protocol_mismatch').", "title": "Code", "type": "string"}, "message": {"description": "Human-readable short message. MUST NOT contain UMMAYA_*-prefixed env var values (FR-004 redaction rule).", "title": "Message", "type": "string"}, "details": {"additionalProperties": true, "description": "Structured error details. UMMAYA_* env var values MUST be redacted.", "title": "Details", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "code", "message", "details"], "title": "ErrorFrame", "type": "object"}, "FrameTrailer": {"additionalProperties": false, "description": "Completion/validation metadata on terminal frames (FR-006).", "properties": {"final": {"description": "True when this frame terminates a logical payload/stream.", "title": "Final", "type": "boolean"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "Mirror of envelope transaction_id for trailer-only consumers. Non-empty when present (parity with codec.ts trailer schema \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "checksum_sha256": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Hex SHA-256 of the concatenated payload bytes for streamed payloads.", "title": "Checksum Sha256"}}, "required": ["final"], "title": "FrameTrailer", "type": "object"}, "HeartbeatFrame": {"additionalProperties": false, "description": "Emitted every 30 s (default) by both sides to prove liveness.\n\nNote: Heartbeat frames do NOT increment frame_seq \u2014 they use a dedicated\ncounter. This keeps ring-buffer economy tight.\nrole allow-list: tui, backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "heartbeat", "default": "heartbeat", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "direction": {"description": "ping from sender, pong from receiver.", "enum": ["ping", "pong"], "title": "Direction", "type": "string"}, "peer_frame_seq": {"description": "Sender's current outbound frame_seq high-water.", "minimum": 0, "title": "Peer Frame Seq", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "direction", "peer_frame_seq"], "title": "HeartbeatFrame", "type": "object"}, "NotificationPushFrame": {"additionalProperties": false, "description": "Push from app/phone notification surfaces.\n\nCarried over the same stdio channel to keep a single correlation plane.\nrole allow-list: notification.\n\nCC parity: NO equivalent \u2014 Claude Code's notification surface is\nterminal OSC sequences (iTerm2, Kitty, Ghostty, bell) emitted\nin-process from ``ink/useTerminalNotification.ts``. There is no\npush-based IPC notification arm in CC. UMMAYA adds this arm as a\nswap-2 addition for Korean civic push channels (KMA disaster CBS,\ngovernment newsroom alerts, hospital alerts) carried over the\nsame stdio plane to keep a single correlation plane. Spec 2642\nEpic F \u00b7 S7 audit recorded this finding (specs/cc-migration-audit/\nscope-S7-ipc-bridge.md \u00a7 5 Finding 3 \u2014 resolved as orthogonal\nUMMAYA swap-2 add-on, not a CC-divergence regression).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "notification_push", "default": "notification_push", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "subscription_id": {"description": "Notification channel handle.", "title": "Subscription Id", "type": "string"}, "adapter_id": {"description": "e.g., disaster_alert_cbs_push, gov_newsroom_push.", "title": "Adapter Id", "type": "string"}, "event_guid": {"description": "RSS guid or CBS event hash for duplicate suppression.", "title": "Event Guid", "type": "string"}, "payload_content_type": {"description": "Inline payload MIME.", "enum": ["text/plain", "application/json"], "title": "Payload Content Type", "type": "string"}, "payload": {"description": "Inline notification content (Korean for civic users).", "title": "Payload", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "subscription_id", "adapter_id", "event_guid", "payload_content_type", "payload"], "title": "NotificationPushFrame", "type": "object"}, "PayloadDeltaFrame": {"additionalProperties": false, "description": "One chunk of a streamed payload.\n\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_delta", "default": "payload_delta", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "delta_seq": {"description": "Monotonic within the payload (first delta = 0).", "minimum": 0, "title": "Delta Seq", "type": "integer"}, "payload": {"description": "UTF-8 text. If content-type is application/json, this is a JSON-encoded fragment string.", "title": "Payload", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "delta_seq", "payload"], "title": "PayloadDeltaFrame", "type": "object"}, "PayloadEndFrame": {"additionalProperties": false, "description": "Terminates a streamed payload.\n\nMUST carry a trailer with final=True.\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_end", "default": "payload_end", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "delta_count": {"description": "Total number of payload_delta frames emitted.", "minimum": 0, "title": "Delta Count", "type": "integer"}, "status": {"description": "Terminal disposition.", "enum": ["ok", "aborted"], "title": "Status", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "delta_count", "status"], "title": "PayloadEndFrame", "type": "object"}, "PayloadStartFrame": {"additionalProperties": false, "description": "Begins a streamed payload (assistant output, tool result chunking).\n\nSender MUST follow with >= 1 payload_delta and exactly one payload_end.\nrole allow-list: backend, tool, llm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "payload_start", "default": "payload_start", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "content_type": {"description": "Payload MIME type.", "enum": ["text/markdown", "application/json", "text/plain"], "title": "Content Type", "type": "string"}, "estimated_bytes": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "Optional size hint for HUD progress bars.", "title": "Estimated Bytes"}}, "required": ["session_id", "correlation_id", "ts", "role", "content_type"], "title": "PayloadStartFrame", "type": "object"}, "PermissionRequestFrame": {"additionalProperties": false, "description": "backend -> TUI: a worker raises a permission request.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "permission_request", "default": "permission_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "request_id": {"description": "ULID; round-trips in the matching permission_response frame.", "title": "Request Id", "type": "string"}, "worker_id": {"description": "Worker requesting permission.", "title": "Worker Id", "type": "string"}, "primitive_kind": {"description": "The primitive the worker wants to invoke.", "enum": ["find", "locate", "send", "check", "document"], "title": "Primitive Kind", "type": "string"}, "description_ko": {"description": "Korean-language description shown to the citizen.", "title": "Description Ko", "type": "string"}, "description_en": {"description": "English-language description shown alongside the Korean one.", "title": "Description En", "type": "string"}, "risk_level": {"description": "Risk classification of the requested operation.", "enum": ["low", "medium", "high"], "title": "Risk Level", "type": "string"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Fully-qualified adapter id (e.g. `mock_verify_mobile_id`). Falls back to worker_id || primitive_kind in the TUI when None. None for legacy callers that have not yet been updated.", "title": "Tool Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "worker_id", "primitive_kind", "description_ko", "description_en", "risk_level"], "title": "PermissionRequestFrame", "type": "object"}, "PermissionResponseFrame": {"additionalProperties": false, "description": "TUI -> backend: citizen's decision on a permission_request.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "permission_response", "default": "permission_response", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "request_id": {"description": "ULID matching the originating permission_request.request_id.", "title": "Request Id", "type": "string"}, "decision": {"description": "Citizen's permission decision.", "enum": ["granted", "allow_once", "allow_session", "denied", "deny"], "title": "Decision", "type": "string"}, "receipt_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Consent receipt UUID written to ~/.ummaya/memdir/user/consent/<id>.json on granted decisions. None on deny / timeout.", "title": "Receipt Id"}, "primitive_kind": {"anyOf": [{"enum": ["find", "locate", "send", "check", "document"], "type": "string"}, {"type": "null"}], "default": null, "description": "The primitive that was authorised. The TUI feeds this into `aalToLayer(primitive, isIrreversible)` to recompute the gauntlet layer (1=green / 2=orange / 3=red) for the receipt row. None on deny / timeout / legacy backends.", "title": "Primitive Kind"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "The fully-qualified adapter id (e.g. `mock_verify_mobile_id`, `mock_submit_welfare_grant`) the citizen authorised. The TUI uses this to render the human-readable Korean adapter name in /consent list and the modal title. None for non-adapter primitives (rare) or legacy backends.", "title": "Tool Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "request_id", "decision"], "title": "PermissionResponseFrame", "type": "object"}, "PluginOpFrame": {"additionalProperties": false, "description": "Plugin install / uninstall / list control-plane frame.\n\nSingle arm carrying the three operation states discriminated by the\ninner ``op`` field. Modelled as one ``kind`` so the IPC discriminator\nkeeps ``plugin_op`` as a single 20th arm \u2014 matching the migration\ntree's \"20th arm\" decision while preserving the per-phase shape\ndocumented in ``contracts/plugin-install.cli.md``.\n\nOp-specific shape rules (enforced by ``_v_plugin_op_shape``):\n\n* ``op=\"request\"``: ``name`` required when ``request_op`` is\n ``\"install\"`` or ``\"uninstall\"``; ``progress_phase`` /\n ``progress_message_ko`` / ``progress_message_en`` / ``result`` /\n ``exit_code`` MUST be ``None``.\n* ``op=\"progress\"``: ``progress_phase`` (1-7), ``progress_message_ko``,\n ``progress_message_en`` required; install-request fields must be\n ``None``.\n* ``op=\"complete\"``: ``result`` + ``exit_code`` required; everything\n else None except optional ``receipt_id``.\n\nrole allow-list: tui (request), backend (progress / complete).", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "plugin_op", "default": "plugin_op", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "op": {"description": "Operation phase. ``request`` = TUI initiates install/uninstall/list; ``progress`` = backend reports phase tick; ``complete`` = backend reports terminal outcome.", "enum": ["request", "progress", "complete"], "title": "Op", "type": "string"}, "request_op": {"anyOf": [{"enum": ["install", "uninstall", "list"], "type": "string"}, {"type": "null"}], "default": null, "description": "Sub-action when op='request'. Required for op='request'; None otherwise.", "title": "Request Op"}, "name": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Plugin catalog name (matches CatalogEntry.name). Required when request_op in {install, uninstall}; None otherwise.", "title": "Name"}, "requested_version": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Optional SemVer pin for op='request'/install. Renamed from `version` to avoid shadowing the envelope's protocol version.", "title": "Requested Version"}, "dry_run": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "default": null, "description": "When True, install verifies but writes nothing (op='request').", "title": "Dry Run"}, "progress_phase": {"anyOf": [{"type": "integer"}, {"type": "null"}], "default": null, "description": "Install phase index 1-7 per contracts/plugin-install.cli.md. Required when op='progress'.", "title": "Progress Phase"}, "progress_message_ko": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Korean-primary progress message shown in the Ink overlay.", "title": "Progress Message Ko"}, "progress_message_en": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "English fallback progress message.", "title": "Progress Message En"}, "result": {"anyOf": [{"enum": ["success", "failure"], "type": "string"}, {"type": "null"}], "default": null, "description": "Terminal outcome. Required when op='complete'.", "title": "Result"}, "exit_code": {"anyOf": [{"type": "integer"}, {"type": "null"}], "default": null, "description": "Process exit code per contracts/plugin-install.cli.md exit-code table. Required when op='complete'.", "title": "Exit Code"}, "receipt_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Spec 035 consent receipt id when op='complete' AND result='success'.", "title": "Receipt Id"}, "error_kind": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Machine-readable failure kind (e.g. 'bundle_sha_mismatch', 'slsa_skip_in_production') when op='complete' AND result='failure'. Used by the TUI to map exit codes to citizen-friendly Korean messages.", "title": "Error Kind"}, "error_message": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Developer-facing English error detail when op='complete' AND result='failure'.", "title": "Error Message"}, "was_idempotent_noop": {"anyOf": [{"type": "boolean"}, {"type": "null"}], "default": null, "description": "True when op='complete' + result='success' but the operation was a no-op because the plugin was already in the target state (e.g. uninstall of a plugin that was never installed). TUI uses this to show '\uc774\ubbf8 \uc81c\uac70\ub428' instead of '\uc81c\uac70 \uc644\ub8cc'.", "title": "Was Idempotent Noop"}}, "required": ["session_id", "correlation_id", "ts", "role", "op"], "title": "PluginOpFrame", "type": "object"}, "ProgressEventFrame": {"additionalProperties": false, "description": "backend -> TUI: deterministic query-loop progress.\n\nThis is intentionally separate from ``AssistantChunkFrame.thinking``.\n``progress_event`` carries safe harness state such as analysis, tool\nselection, tool dispatch/result, and answer synthesis. Provider reasoning\nremains on the gated ``thinking_delta`` channel.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "progress_event", "default": "progress_event", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "phase": {"description": "Safe query-loop phase represented by this event.", "enum": ["analysis", "tool_selection", "tool_call", "tool_result", "answer_synthesis"], "title": "Phase", "type": "string"}, "message_ko": {"description": "Korean progress text for the TUI.", "minLength": 1, "title": "Message Ko", "type": "string"}, "message_en": {"description": "English fallback progress text.", "minLength": 1, "title": "Message En", "type": "string"}, "safe_to_persist": {"default": true, "description": "True because this channel never carries raw provider chain-of-thought.", "title": "Safe To Persist", "type": "boolean"}, "tool_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Concrete adapter/tool id when this event is tied to one.", "title": "Tool Id"}, "call_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Tool call id when this event is tied to a specific invocation.", "title": "Call Id"}}, "required": ["session_id", "correlation_id", "ts", "role", "phase", "message_ko", "message_en"], "title": "ProgressEventFrame", "type": "object"}, "ResumeRejectedFrame": {"additionalProperties": false, "description": "Backend cannot honor the resume request.\n\nTrailer with final=True MUST be set (E6).\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_rejected", "default": "resume_rejected", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "reason": {"description": "Machine-readable reason code.", "enum": ["ring_evicted", "session_unknown", "token_mismatch", "protocol_incompatible", "session_expired"], "title": "Reason", "type": "string"}, "detail": {"description": "Human-readable Korean/English detail for HUD.", "title": "Detail", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "reason", "detail"], "title": "ResumeRejectedFrame", "type": "object"}, "ResumeRequestFrame": {"additionalProperties": false, "description": "Sent by the reconnecting TUI after a stdio drop.\n\nrole allow-list: tui.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_request", "default": "resume_request", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "last_seen_correlation_id": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Last correlation_id the TUI successfully applied. None if no prior frame.", "title": "Last Seen Correlation Id"}, "last_seen_frame_seq": {"anyOf": [{"minimum": 0, "type": "integer"}, {"type": "null"}], "default": null, "description": "Last frame_seq applied. None if none.", "title": "Last Seen Frame Seq"}, "tui_session_token": {"description": "TUI-local session token for authenticity binding.", "minLength": 1, "title": "Tui Session Token", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "tui_session_token"], "title": "ResumeRequestFrame", "type": "object"}, "ResumeResponseFrame": {"additionalProperties": false, "description": "Backend accepts the resume.\n\nMust be followed by replay of frames with frame_seq > last_seen_frame_seq.\nTrailer with final=True MUST be set (E6).\nrole allow-list: backend.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "resume_response", "default": "resume_response", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "resumed_from_frame_seq": {"description": "Inclusive lower bound of frames that will be replayed.", "minimum": 0, "title": "Resumed From Frame Seq", "type": "integer"}, "replay_count": {"description": "Total frames the backend will replay. Bounded by ring buffer size.", "minimum": 0, "title": "Replay Count", "type": "integer"}, "server_session_id": {"description": "Backend-assigned session id the TUI should use going forward.", "title": "Server Session Id", "type": "string"}, "heartbeat_interval_ms": {"description": "Negotiated heartbeat cadence (default 30000).", "minimum": 1000, "title": "Heartbeat Interval Ms", "type": "integer"}}, "required": ["session_id", "correlation_id", "ts", "role", "resumed_from_frame_seq", "replay_count", "server_session_id", "heartbeat_interval_ms"], "title": "ResumeResponseFrame", "type": "object"}, "SessionEventFrame": {"additionalProperties": false, "description": "Bidirectional: session lifecycle events.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "session_event", "default": "session_event", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "event": {"description": "Session lifecycle event type.", "enum": ["save", "load", "list", "resume", "new", "exit"], "title": "Event", "type": "string"}, "payload": {"additionalProperties": true, "description": "Event-specific payload. For list: {sessions: [{id, created_at, turn_count}]}. For resume: {id: str}. For others: {}.", "title": "Payload", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "event", "payload"], "title": "SessionEventFrame", "type": "object"}, "ToolCallFrame": {"additionalProperties": false, "description": "backend -> TUI (display only): a tool invocation decision by the model.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "tool_call", "default": "tool_call", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "call_id": {"description": "ULID correlating this call to its subsequent tool_result.", "title": "Call Id", "type": "string"}, "name": {"description": "Concrete tool name selected by the model; root primitive names remain valid for legacy transcripts.", "minLength": 1, "title": "Name", "type": "string"}, "arguments": {"additionalProperties": true, "description": "Tool-specific arguments. Concrete adapter calls carry adapter schema fields directly.", "title": "Arguments", "type": "object"}}, "required": ["session_id", "correlation_id", "ts", "role", "call_id", "name", "arguments"], "title": "ToolCallFrame", "type": "object"}, "ToolDefinition": {"additionalProperties": false, "description": "OpenAI-style tool definition (function-calling).", "properties": {"type": {"const": "function", "default": "function", "description": "OpenAI tool envelope; only 'function' is currently supported.", "title": "Type", "type": "string"}, "function": {"$ref": "#/$defs/ToolDefinitionFunction", "description": "Inner function metadata."}}, "required": ["function"], "title": "ToolDefinition", "type": "object"}, "ToolDefinitionFunction": {"additionalProperties": false, "description": "Inner ``function`` block of an OpenAI-style tool definition.", "properties": {"name": {"description": "Tool name (matches the primitive registry id).", "title": "Name", "type": "string"}, "description": {"anyOf": [{"type": "string"}, {"type": "null"}], "default": null, "description": "Human-readable description shown to the model for tool selection.", "title": "Description"}, "parameters": {"additionalProperties": true, "description": "JSON Schema (Draft 2020-12) for the tool input. Pydantic accepts any dict shape; deeper schema validation is delegated to LLMClient.", "title": "Parameters", "type": "object"}}, "required": ["name"], "title": "ToolDefinitionFunction", "type": "object"}, "ToolResultEnvelope": {"additionalProperties": true, "description": "Active primitive discriminated union envelope (open schema).", "properties": {"kind": {"description": "Primitive kind discriminator per Spec 031.", "enum": ["find", "locate", "send", "check", "document"], "title": "Kind", "type": "string"}}, "required": ["kind"], "title": "ToolResultEnvelope", "type": "object"}, "ToolResultFrame": {"additionalProperties": false, "description": "backend -> TUI (render): the output of a tool invocation.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "tool_result", "default": "tool_result", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "call_id": {"description": "ULID correlating this result to its originating tool_call.", "title": "Call Id", "type": "string"}, "envelope": {"$ref": "#/$defs/ToolResultEnvelope", "description": "Active primitive discriminated union. Unknown kind falls to UnrecognizedPayload."}}, "required": ["session_id", "correlation_id", "ts", "role", "call_id", "envelope"], "title": "ToolResultFrame", "type": "object"}, "UserInputFrame": {"additionalProperties": false, "description": "TUI -> backend: a citizen's typed input.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "user_input", "default": "user_input", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "text": {"description": "Raw user text in UTF-8 (may contain Korean, English, emoji).", "title": "Text", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "text"], "title": "UserInputFrame", "type": "object"}, "WorkerStatusFrame": {"additionalProperties": false, "description": "backend -> TUI: per-worker status row update from Spec 027 swarm.", "properties": {"session_id": {"description": "Opaque session identifier.", "title": "Session Id", "type": "string"}, "correlation_id": {"description": "UUIDv7 string for new emissions; ULID accepted for back-compat. Non-empty; emitter SHOULD use UUIDv7. (E5)", "minLength": 1, "title": "Correlation Id", "type": "string"}, "ts": {"description": "ISO-8601 UTC timestamp with sub-ms precision.", "title": "Ts", "type": "string"}, "version": {"const": "1.0", "default": "1.0", "description": "Envelope version. Hard-fail on mismatch (E1, FR-001).", "title": "Version", "type": "string"}, "role": {"description": "Origin role. Validated against kind<->role allow-list (E3, FR-004).", "enum": ["tui", "backend", "tool", "llm", "notification"], "title": "Role", "type": "string"}, "frame_seq": {"default": 0, "description": "Per-session monotonic sequence number (ge=0). Gap detection uses this.", "minimum": 0, "title": "Frame Seq", "type": "integer"}, "transaction_id": {"anyOf": [{"minLength": 1, "type": "string"}, {"type": "null"}], "default": null, "description": "UUIDv7. Populated for idempotent state-change frames (irreversible tools). None for streaming chunks. (FR-026) Non-empty when present (parity with codec.ts ``z.string().min(1).nullable().optional()`` \u2014 Spec 2642 \u00a7 US3).", "title": "Transaction Id"}, "trailer": {"anyOf": [{"$ref": "#/$defs/FrameTrailer"}, {"type": "null"}], "default": null, "description": "Completion/validation metadata. Populated on terminal frames. (FR-006)"}, "kind": {"const": "worker_status", "default": "worker_status", "description": "Frame discriminator.", "title": "Kind", "type": "string"}, "worker_id": {"description": "Unique worker identifier.", "title": "Worker Id", "type": "string"}, "role_id": {"description": "Specialist label (e.g., transport-specialist, health-specialist).", "title": "Role Id", "type": "string"}, "current_primitive": {"description": "Primitive currently being invoked by this worker.", "enum": ["find", "locate", "send", "check", "document"], "title": "Current Primitive", "type": "string"}, "status": {"description": "Worker execution status.", "enum": ["idle", "running", "waiting_permission", "error"], "title": "Status", "type": "string"}}, "required": ["session_id", "correlation_id", "ts", "role", "worker_id", "role_id", "current_primitive", "status"], "title": "WorkerStatusFrame", "type": "object"}}, "discriminator": {"mapping": {"adapter_manifest_sync": "#/$defs/AdapterManifestSyncFrame", "assistant_chunk": "#/$defs/AssistantChunkFrame", "backpressure": "#/$defs/BackpressureSignalFrame", "chat_request": "#/$defs/ChatRequestFrame", "consent_revoke_request": "#/$defs/ConsentRevokeRequestFrame", "consent_revoke_response": "#/$defs/ConsentRevokeResponseFrame", "coordinator_phase": "#/$defs/CoordinatorPhaseFrame", "error": "#/$defs/ErrorFrame", "heartbeat": "#/$defs/HeartbeatFrame", "notification_push": "#/$defs/NotificationPushFrame", "payload_delta": "#/$defs/PayloadDeltaFrame", "payload_end": "#/$defs/PayloadEndFrame", "payload_start": "#/$defs/PayloadStartFrame", "permission_request": "#/$defs/PermissionRequestFrame", "permission_response": "#/$defs/PermissionResponseFrame", "plugin_op": "#/$defs/PluginOpFrame", "progress_event": "#/$defs/ProgressEventFrame", "resume_rejected": "#/$defs/ResumeRejectedFrame", "resume_request": "#/$defs/ResumeRequestFrame", "resume_response": "#/$defs/ResumeResponseFrame", "session_event": "#/$defs/SessionEventFrame", "tool_call": "#/$defs/ToolCallFrame", "tool_result": "#/$defs/ToolResultFrame", "user_input": "#/$defs/UserInputFrame", "worker_status": "#/$defs/WorkerStatusFrame"}, "propertyName": "kind"}, "oneOf": [{"$ref": "#/$defs/UserInputFrame"}, {"$ref": "#/$defs/ChatRequestFrame"}, {"$ref": "#/$defs/AssistantChunkFrame"}, {"$ref": "#/$defs/ProgressEventFrame"}, {"$ref": "#/$defs/ToolCallFrame"}, {"$ref": "#/$defs/ToolResultFrame"}, {"$ref": "#/$defs/CoordinatorPhaseFrame"}, {"$ref": "#/$defs/WorkerStatusFrame"}, {"$ref": "#/$defs/PermissionRequestFrame"}, {"$ref": "#/$defs/PermissionResponseFrame"}, {"$ref": "#/$defs/SessionEventFrame"}, {"$ref": "#/$defs/ErrorFrame"}, {"$ref": "#/$defs/PayloadStartFrame"}, {"$ref": "#/$defs/PayloadDeltaFrame"}, {"$ref": "#/$defs/PayloadEndFrame"}, {"$ref": "#/$defs/BackpressureSignalFrame"}, {"$ref": "#/$defs/ResumeRequestFrame"}, {"$ref": "#/$defs/ResumeResponseFrame"}, {"$ref": "#/$defs/ResumeRejectedFrame"}, {"$ref": "#/$defs/HeartbeatFrame"}, {"$ref": "#/$defs/NotificationPushFrame"}, {"$ref": "#/$defs/PluginOpFrame"}, {"$ref": "#/$defs/AdapterManifestSyncFrame"}, {"$ref": "#/$defs/ConsentRevokeRequestFrame"}, {"$ref": "#/$defs/ConsentRevokeResponseFrame"}]}
|
|
@@ -338,3 +338,7 @@ export const DEFAULT_BINDINGS: KeybindingBlock[] = [
|
|
|
338
338
|
},
|
|
339
339
|
},
|
|
340
340
|
]
|
|
341
|
+
|
|
342
|
+
// Backwards-compatible name used by older focused TUI tests and snapshot
|
|
343
|
+
// harnesses. The active runtime import remains DEFAULT_BINDINGS.
|
|
344
|
+
export const DEFAULT_BINDING_BLOCKS = DEFAULT_BINDINGS
|