@trenchwork/coder 1.3.0
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/LICENSE +16 -0
- package/README.md +173 -0
- package/agents/trenchwork-code.rules.json +199 -0
- package/dist/bin/deepseek.d.ts +3 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +23 -0
- package/dist/bin/deepseek.js.map +1 -0
- package/dist/capabilities/baseCapability.d.ts +72 -0
- package/dist/capabilities/baseCapability.d.ts.map +1 -0
- package/dist/capabilities/baseCapability.js +183 -0
- package/dist/capabilities/baseCapability.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +24 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/editCapability.d.ts +17 -0
- package/dist/capabilities/editCapability.d.ts.map +1 -0
- package/dist/capabilities/editCapability.js +27 -0
- package/dist/capabilities/editCapability.js.map +1 -0
- package/dist/capabilities/enhancedGitCapability.d.ts +7 -0
- package/dist/capabilities/enhancedGitCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedGitCapability.js +220 -0
- package/dist/capabilities/enhancedGitCapability.js.map +1 -0
- package/dist/capabilities/filesystemCapability.d.ts +13 -0
- package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
- package/dist/capabilities/filesystemCapability.js +24 -0
- package/dist/capabilities/filesystemCapability.js.map +1 -0
- package/dist/capabilities/gitHistoryCapability.d.ts +6 -0
- package/dist/capabilities/gitHistoryCapability.d.ts.map +1 -0
- package/dist/capabilities/gitHistoryCapability.js +184 -0
- package/dist/capabilities/gitHistoryCapability.js.map +1 -0
- package/dist/capabilities/hitlCapability.d.ts +18 -0
- package/dist/capabilities/hitlCapability.d.ts.map +1 -0
- package/dist/capabilities/hitlCapability.js +29 -0
- package/dist/capabilities/hitlCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +11 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +16 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/memoryCapability.d.ts +10 -0
- package/dist/capabilities/memoryCapability.d.ts.map +1 -0
- package/dist/capabilities/memoryCapability.js +22 -0
- package/dist/capabilities/memoryCapability.js.map +1 -0
- package/dist/capabilities/notebookCapability.d.ts +6 -0
- package/dist/capabilities/notebookCapability.d.ts.map +1 -0
- package/dist/capabilities/notebookCapability.js +17 -0
- package/dist/capabilities/notebookCapability.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +19 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +29 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/skillCapability.d.ts +6 -0
- package/dist/capabilities/skillCapability.d.ts.map +1 -0
- package/dist/capabilities/skillCapability.js +17 -0
- package/dist/capabilities/skillCapability.js.map +1 -0
- package/dist/capabilities/todoCapability.d.ts +11 -0
- package/dist/capabilities/todoCapability.d.ts.map +1 -0
- package/dist/capabilities/todoCapability.js +22 -0
- package/dist/capabilities/todoCapability.js.map +1 -0
- package/dist/capabilities/toolManifest.d.ts +3 -0
- package/dist/capabilities/toolManifest.d.ts.map +1 -0
- package/dist/capabilities/toolManifest.js +163 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +25 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +150 -0
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/capabilities/unifiedCodingCapability.d.ts +62 -0
- package/dist/capabilities/unifiedCodingCapability.d.ts.map +1 -0
- package/dist/capabilities/unifiedCodingCapability.js +790 -0
- package/dist/capabilities/unifiedCodingCapability.js.map +1 -0
- package/dist/capabilities/webCapability.d.ts +23 -0
- package/dist/capabilities/webCapability.d.ts.map +1 -0
- package/dist/capabilities/webCapability.js +33 -0
- package/dist/capabilities/webCapability.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +181 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +25 -0
- package/dist/contracts/agent-schemas.json +158 -0
- package/dist/contracts/models.schema.json +9 -0
- package/dist/contracts/module-schema.json +367 -0
- package/dist/contracts/schemas/agent-profile.schema.json +157 -0
- package/dist/contracts/schemas/agent-rules.schema.json +238 -0
- package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
- package/dist/contracts/schemas/agent.schema.json +90 -0
- package/dist/contracts/schemas/tool-selection.schema.json +174 -0
- package/dist/contracts/tools.schema.json +42 -0
- package/dist/contracts/unified-schema.json +40 -0
- package/dist/contracts/v1/agent.d.ts +225 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +8 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +7 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +7 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/adversarial.d.ts +38 -0
- package/dist/core/adversarial.d.ts.map +1 -0
- package/dist/core/adversarial.js +106 -0
- package/dist/core/adversarial.js.map +1 -0
- package/dist/core/adversarialCorrection.d.ts +22 -0
- package/dist/core/adversarialCorrection.d.ts.map +1 -0
- package/dist/core/adversarialCorrection.js +25 -0
- package/dist/core/adversarialCorrection.js.map +1 -0
- package/dist/core/agent.d.ts +331 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1637 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentProfileManifest.d.ts +3 -0
- package/dist/core/agentProfileManifest.d.ts.map +1 -0
- package/dist/core/agentProfileManifest.js +188 -0
- package/dist/core/agentProfileManifest.js.map +1 -0
- package/dist/core/agentProfiles.d.ts +22 -0
- package/dist/core/agentProfiles.d.ts.map +1 -0
- package/dist/core/agentProfiles.js +35 -0
- package/dist/core/agentProfiles.js.map +1 -0
- package/dist/core/agentRegistry.d.ts +111 -0
- package/dist/core/agentRegistry.d.ts.map +1 -0
- package/dist/core/agentRegistry.js +229 -0
- package/dist/core/agentRegistry.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +11 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +136 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaLoader.d.ts +131 -0
- package/dist/core/agentSchemaLoader.d.ts.map +1 -0
- package/dist/core/agentSchemaLoader.js +235 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/aiErrorFixer.d.ts +57 -0
- package/dist/core/aiErrorFixer.d.ts.map +1 -0
- package/dist/core/aiErrorFixer.js +214 -0
- package/dist/core/aiErrorFixer.js.map +1 -0
- package/dist/core/bashCommandGuidance.d.ts +16 -0
- package/dist/core/bashCommandGuidance.d.ts.map +1 -0
- package/dist/core/bashCommandGuidance.js +40 -0
- package/dist/core/bashCommandGuidance.js.map +1 -0
- package/dist/core/compactionNote.d.ts +13 -0
- package/dist/core/compactionNote.d.ts.map +1 -0
- package/dist/core/compactionNote.js +13 -0
- package/dist/core/compactionNote.js.map +1 -0
- package/dist/core/constants.d.ts +31 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +62 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/contextManager.d.ts +271 -0
- package/dist/core/contextManager.d.ts.map +1 -0
- package/dist/core/contextManager.js +1076 -0
- package/dist/core/contextManager.js.map +1 -0
- package/dist/core/contextUsage.d.ts +28 -0
- package/dist/core/contextUsage.d.ts.map +1 -0
- package/dist/core/contextUsage.js +62 -0
- package/dist/core/contextUsage.js.map +1 -0
- package/dist/core/contextWindow.d.ts +42 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +127 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/customCommands.d.ts +19 -0
- package/dist/core/customCommands.d.ts.map +1 -0
- package/dist/core/customCommands.js +85 -0
- package/dist/core/customCommands.js.map +1 -0
- package/dist/core/diffPanel.d.ts +30 -0
- package/dist/core/diffPanel.d.ts.map +1 -0
- package/dist/core/diffPanel.js +48 -0
- package/dist/core/diffPanel.js.map +1 -0
- package/dist/core/errorClassification.d.ts +44 -0
- package/dist/core/errorClassification.d.ts.map +1 -0
- package/dist/core/errorClassification.js +333 -0
- package/dist/core/errorClassification.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +159 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +111 -0
- package/dist/core/errors/errorTypes.d.ts.map +1 -0
- package/dist/core/errors/errorTypes.js +345 -0
- package/dist/core/errors/errorTypes.js.map +1 -0
- package/dist/core/errors/index.d.ts +50 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +156 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/networkErrors.d.ts +14 -0
- package/dist/core/errors/networkErrors.d.ts.map +1 -0
- package/dist/core/errors/networkErrors.js +53 -0
- package/dist/core/errors/networkErrors.js.map +1 -0
- package/dist/core/errors/safetyValidator.d.ts +109 -0
- package/dist/core/errors/safetyValidator.d.ts.map +1 -0
- package/dist/core/errors/safetyValidator.js +272 -0
- package/dist/core/errors/safetyValidator.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/failureRegistry.d.ts +30 -0
- package/dist/core/failureRegistry.d.ts.map +1 -0
- package/dist/core/failureRegistry.js +74 -0
- package/dist/core/failureRegistry.js.map +1 -0
- package/dist/core/fileMentions.d.ts +40 -0
- package/dist/core/fileMentions.d.ts.map +1 -0
- package/dist/core/fileMentions.js +136 -0
- package/dist/core/fileMentions.js.map +1 -0
- package/dist/core/finalResponseFormatter.d.ts +10 -0
- package/dist/core/finalResponseFormatter.d.ts.map +1 -0
- package/dist/core/finalResponseFormatter.js +14 -0
- package/dist/core/finalResponseFormatter.js.map +1 -0
- package/dist/core/guardrails.d.ts +146 -0
- package/dist/core/guardrails.d.ts.map +1 -0
- package/dist/core/guardrails.js +361 -0
- package/dist/core/guardrails.js.map +1 -0
- package/dist/core/hitl.d.ts +119 -0
- package/dist/core/hitl.d.ts.map +1 -0
- package/dist/core/hitl.js +396 -0
- package/dist/core/hitl.js.map +1 -0
- package/dist/core/hooks.d.ts +95 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +236 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/hostedAuth.d.ts +88 -0
- package/dist/core/hostedAuth.d.ts.map +1 -0
- package/dist/core/hostedAuth.js +219 -0
- package/dist/core/hostedAuth.js.map +1 -0
- package/dist/core/inputProtection.d.ts +122 -0
- package/dist/core/inputProtection.d.ts.map +1 -0
- package/dist/core/inputProtection.js +422 -0
- package/dist/core/inputProtection.js.map +1 -0
- package/dist/core/modelDiscovery.d.ts +102 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +416 -0
- package/dist/core/modelDiscovery.js.map +1 -0
- package/dist/core/multilinePasteHandler.d.ts +35 -0
- package/dist/core/multilinePasteHandler.d.ts.map +1 -0
- package/dist/core/multilinePasteHandler.js +81 -0
- package/dist/core/multilinePasteHandler.js.map +1 -0
- package/dist/core/permissionMode.d.ts +40 -0
- package/dist/core/permissionMode.d.ts.map +1 -0
- package/dist/core/permissionMode.js +86 -0
- package/dist/core/permissionMode.js.map +1 -0
- package/dist/core/postWriteDiagnostics.d.ts +32 -0
- package/dist/core/postWriteDiagnostics.d.ts.map +1 -0
- package/dist/core/postWriteDiagnostics.js +127 -0
- package/dist/core/postWriteDiagnostics.js.map +1 -0
- package/dist/core/preferences.d.ts +66 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +310 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/quota.d.ts +61 -0
- package/dist/core/quota.d.ts.map +1 -0
- package/dist/core/quota.js +104 -0
- package/dist/core/quota.js.map +1 -0
- package/dist/core/quotaErrors.d.ts +42 -0
- package/dist/core/quotaErrors.d.ts.map +1 -0
- package/dist/core/quotaErrors.js +86 -0
- package/dist/core/quotaErrors.js.map +1 -0
- package/dist/core/refusalDetection.d.ts +2 -0
- package/dist/core/refusalDetection.d.ts.map +1 -0
- package/dist/core/refusalDetection.js +51 -0
- package/dist/core/refusalDetection.js.map +1 -0
- package/dist/core/relativeTime.d.ts +8 -0
- package/dist/core/relativeTime.d.ts.map +1 -0
- package/dist/core/relativeTime.js +29 -0
- package/dist/core/relativeTime.js.map +1 -0
- package/dist/core/resultVerification.d.ts +48 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +127 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/rewind.d.ts +14 -0
- package/dist/core/rewind.d.ts.map +1 -0
- package/dist/core/rewind.js +25 -0
- package/dist/core/rewind.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +49 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +234 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +59 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +278 -0
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/sessionStorage.d.ts +10 -0
- package/dist/core/sessionStorage.d.ts.map +1 -0
- package/dist/core/sessionStorage.js +46 -0
- package/dist/core/sessionStorage.js.map +1 -0
- package/dist/core/sessionStore.d.ts +35 -0
- package/dist/core/sessionStore.d.ts.map +1 -0
- package/dist/core/sessionStore.js +190 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/shutdown.d.ts +34 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +186 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/slashCommands.d.ts +38 -0
- package/dist/core/slashCommands.d.ts.map +1 -0
- package/dist/core/slashCommands.js +72 -0
- package/dist/core/slashCommands.js.map +1 -0
- package/dist/core/subAgentNote.d.ts +15 -0
- package/dist/core/subAgentNote.d.ts.map +1 -0
- package/dist/core/subAgentNote.js +16 -0
- package/dist/core/subAgentNote.js.map +1 -0
- package/dist/core/sudoPasswordManager.d.ts +52 -0
- package/dist/core/sudoPasswordManager.d.ts.map +1 -0
- package/dist/core/sudoPasswordManager.js +115 -0
- package/dist/core/sudoPasswordManager.js.map +1 -0
- package/dist/core/taskCompletionDetector.d.ts +117 -0
- package/dist/core/taskCompletionDetector.d.ts.map +1 -0
- package/dist/core/taskCompletionDetector.js +532 -0
- package/dist/core/taskCompletionDetector.js.map +1 -0
- package/dist/core/testFailureMonitor.d.ts +67 -0
- package/dist/core/testFailureMonitor.d.ts.map +1 -0
- package/dist/core/testFailureMonitor.js +262 -0
- package/dist/core/testFailureMonitor.js.map +1 -0
- package/dist/core/thinkingVerbs.d.ts +31 -0
- package/dist/core/thinkingVerbs.d.ts.map +1 -0
- package/dist/core/thinkingVerbs.js +58 -0
- package/dist/core/thinkingVerbs.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +34 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -0
- package/dist/core/toolPreconditions.js +242 -0
- package/dist/core/toolPreconditions.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +193 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +526 -0
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/turnGovernor.d.ts +63 -0
- package/dist/core/turnGovernor.d.ts.map +1 -0
- package/dist/core/turnGovernor.js +94 -0
- package/dist/core/turnGovernor.js.map +1 -0
- package/dist/core/types/utilityTypes.d.ts +183 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +273 -0
- package/dist/core/types/utilityTypes.js.map +1 -0
- package/dist/core/types.d.ts +334 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +76 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/updateChecker.d.ts +148 -0
- package/dist/core/updateChecker.d.ts.map +1 -0
- package/dist/core/updateChecker.js +605 -0
- package/dist/core/updateChecker.js.map +1 -0
- package/dist/core/usage.d.ts +28 -0
- package/dist/core/usage.d.ts.map +1 -0
- package/dist/core/usage.js +77 -0
- package/dist/core/usage.js.map +1 -0
- package/dist/headless/interactiveShell.d.ts +47 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +2495 -0
- package/dist/headless/interactiveShell.js.map +1 -0
- package/dist/leanAgent.d.ts +73 -0
- package/dist/leanAgent.d.ts.map +1 -0
- package/dist/leanAgent.js +177 -0
- package/dist/leanAgent.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +12 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +123 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +10 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/providers/baseProvider.d.ts +140 -0
- package/dist/providers/baseProvider.d.ts.map +1 -0
- package/dist/providers/baseProvider.js +230 -0
- package/dist/providers/baseProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +70 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +971 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +22 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +25 -0
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/providers/resilientProvider.d.ts +96 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +251 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +137 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +784 -0
- package/dist/runtime/agentController.js.map +1 -0
- package/dist/runtime/agentHost.d.ts +61 -0
- package/dist/runtime/agentHost.d.ts.map +1 -0
- package/dist/runtime/agentHost.js +158 -0
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +49 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +218 -0
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/agentSpawningWiring.d.ts +32 -0
- package/dist/runtime/agentSpawningWiring.d.ts.map +1 -0
- package/dist/runtime/agentSpawningWiring.js +114 -0
- package/dist/runtime/agentSpawningWiring.js.map +1 -0
- package/dist/runtime/node.d.ts +7 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +50 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +18 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +21 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +27 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +53 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +12 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +16 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/toolPresentation.d.ts +54 -0
- package/dist/shell/toolPresentation.d.ts.map +1 -0
- package/dist/shell/toolPresentation.js +334 -0
- package/dist/shell/toolPresentation.js.map +1 -0
- package/dist/tools/bashTools.d.ts +11 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +785 -0
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +43 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +607 -0
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/editTools.d.ts +29 -0
- package/dist/tools/editTools.d.ts.map +1 -0
- package/dist/tools/editTools.js +792 -0
- package/dist/tools/editTools.js.map +1 -0
- package/dist/tools/fileChangeTracker.d.ts +47 -0
- package/dist/tools/fileChangeTracker.d.ts.map +1 -0
- package/dist/tools/fileChangeTracker.js +154 -0
- package/dist/tools/fileChangeTracker.js.map +1 -0
- package/dist/tools/fileReadTracker.d.ts +69 -0
- package/dist/tools/fileReadTracker.d.ts.map +1 -0
- package/dist/tools/fileReadTracker.js +213 -0
- package/dist/tools/fileReadTracker.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +389 -0
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/grepTools.d.ts +3 -0
- package/dist/tools/grepTools.d.ts.map +1 -0
- package/dist/tools/grepTools.js +137 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/hitlTools.d.ts +7 -0
- package/dist/tools/hitlTools.d.ts.map +1 -0
- package/dist/tools/hitlTools.js +185 -0
- package/dist/tools/hitlTools.js.map +1 -0
- package/dist/tools/memoryTools.d.ts +27 -0
- package/dist/tools/memoryTools.d.ts.map +1 -0
- package/dist/tools/memoryTools.js +197 -0
- package/dist/tools/memoryTools.js.map +1 -0
- package/dist/tools/notebookTools.d.ts +20 -0
- package/dist/tools/notebookTools.d.ts.map +1 -0
- package/dist/tools/notebookTools.js +140 -0
- package/dist/tools/notebookTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +12 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +414 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/skillTools.d.ts +24 -0
- package/dist/tools/skillTools.d.ts.map +1 -0
- package/dist/tools/skillTools.js +140 -0
- package/dist/tools/skillTools.js.map +1 -0
- package/dist/tools/todoTools.d.ts +23 -0
- package/dist/tools/todoTools.d.ts.map +1 -0
- package/dist/tools/todoTools.js +120 -0
- package/dist/tools/todoTools.js.map +1 -0
- package/dist/tools/webTools.d.ts +26 -0
- package/dist/tools/webTools.d.ts.map +1 -0
- package/dist/tools/webTools.js +467 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/ui/ink/App.d.ts +53 -0
- package/dist/ui/ink/App.d.ts.map +1 -0
- package/dist/ui/ink/App.js +13 -0
- package/dist/ui/ink/App.js.map +1 -0
- package/dist/ui/ink/ChatStatic.d.ts +30 -0
- package/dist/ui/ink/ChatStatic.d.ts.map +1 -0
- package/dist/ui/ink/ChatStatic.js +83 -0
- package/dist/ui/ink/ChatStatic.js.map +1 -0
- package/dist/ui/ink/InkPromptController.d.ts +321 -0
- package/dist/ui/ink/InkPromptController.d.ts.map +1 -0
- package/dist/ui/ink/InkPromptController.js +667 -0
- package/dist/ui/ink/InkPromptController.js.map +1 -0
- package/dist/ui/ink/Menu.d.ts +21 -0
- package/dist/ui/ink/Menu.d.ts.map +1 -0
- package/dist/ui/ink/Menu.js +61 -0
- package/dist/ui/ink/Menu.js.map +1 -0
- package/dist/ui/ink/Prompt.d.ts +47 -0
- package/dist/ui/ink/Prompt.d.ts.map +1 -0
- package/dist/ui/ink/Prompt.js +571 -0
- package/dist/ui/ink/Prompt.js.map +1 -0
- package/dist/ui/ink/StatusLine.d.ts +35 -0
- package/dist/ui/ink/StatusLine.d.ts.map +1 -0
- package/dist/ui/ink/StatusLine.js +66 -0
- package/dist/ui/ink/StatusLine.js.map +1 -0
- package/dist/ui/ink/pasteBuffer.d.ts +44 -0
- package/dist/ui/ink/pasteBuffer.d.ts.map +1 -0
- package/dist/ui/ink/pasteBuffer.js +73 -0
- package/dist/ui/ink/pasteBuffer.js.map +1 -0
- package/dist/ui/theme.d.ts +351 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +435 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/utils/analytics.d.ts +2 -0
- package/dist/utils/analytics.d.ts.map +1 -0
- package/dist/utils/analytics.js +51 -0
- package/dist/utils/analytics.js.map +1 -0
- package/dist/utils/asyncUtils.d.ts +95 -0
- package/dist/utils/asyncUtils.d.ts.map +1 -0
- package/dist/utils/asyncUtils.js +286 -0
- package/dist/utils/asyncUtils.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +6 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +39 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +12 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +83 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +10 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +78 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/packageInfo.d.ts +14 -0
- package/dist/utils/packageInfo.d.ts.map +1 -0
- package/dist/utils/packageInfo.js +45 -0
- package/dist/utils/packageInfo.js.map +1 -0
- package/dist/utils/planFormatter.d.ts +34 -0
- package/dist/utils/planFormatter.d.ts.map +1 -0
- package/dist/utils/planFormatter.js +141 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/dist/utils/securityUtils.d.ts +132 -0
- package/dist/utils/securityUtils.d.ts.map +1 -0
- package/dist/utils/securityUtils.js +324 -0
- package/dist/utils/securityUtils.js.map +1 -0
- package/dist/utils/statusReporter.d.ts +6 -0
- package/dist/utils/statusReporter.d.ts.map +1 -0
- package/dist/utils/statusReporter.js +26 -0
- package/dist/utils/statusReporter.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +135 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace.validator.d.ts +49 -0
- package/dist/workspace.validator.d.ts.map +1 -0
- package/dist/workspace.validator.js +215 -0
- package/dist/workspace.validator.js.map +1 -0
- package/package.json +116 -0
- package/scripts/postinstall.cjs +56 -0
|
@@ -0,0 +1,667 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InkPromptController — the CLI's prompt controller, backed by the Ink
|
|
3
|
+
* renderer. Constructed via createPromptController(); it is the only
|
|
4
|
+
* renderer the shell uses.
|
|
5
|
+
*
|
|
6
|
+
* Goal: satisfy every method that src/headless/interactiveShell.ts calls
|
|
7
|
+
* so the rest of the codebase doesn't notice the swap. Live methods
|
|
8
|
+
* (status, history, secret mode, menu) drive an Ink reconciler commit;
|
|
9
|
+
* decorative methods that don't yet have an Ink implementation are
|
|
10
|
+
* marked as TODOs and behave as no-ops, with the call recorded so
|
|
11
|
+
* future hardening can fill the gaps with real behaviour rather than
|
|
12
|
+
* silent drift.
|
|
13
|
+
*
|
|
14
|
+
* Renderer shim: interactiveShell.ts also calls a handful of methods
|
|
15
|
+
* directly via promptController.getRenderer() — addEvent, addOutputTap,
|
|
16
|
+
* captureInput, clearBuffer, setSecretMode, forceRender. We expose a
|
|
17
|
+
* facade implementing exactly those.
|
|
18
|
+
*/
|
|
19
|
+
import { EventEmitter } from 'node:events';
|
|
20
|
+
import { cyclePermissionMode, permissionHint, permissionStatusChip } from '../../core/permissionMode.js';
|
|
21
|
+
import { isGenericThinking } from '../../core/thinkingVerbs.js';
|
|
22
|
+
/** Map RendererEventType (UnifiedUIRenderer) to ChatItem.kind. */
|
|
23
|
+
const EVENT_KIND_MAP = {
|
|
24
|
+
banner: 'banner',
|
|
25
|
+
system: 'system',
|
|
26
|
+
error: 'error',
|
|
27
|
+
response: 'assistant',
|
|
28
|
+
stream: 'assistant',
|
|
29
|
+
thought: 'system',
|
|
30
|
+
tool: 'tool',
|
|
31
|
+
'tool-call': 'tool',
|
|
32
|
+
'tool-result': 'toolResult',
|
|
33
|
+
raw: 'system',
|
|
34
|
+
streaming: 'system',
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The minimal subset of the legacy UnifiedUIRenderer that
|
|
38
|
+
* interactiveShell.ts actually calls. Backed by Ink state under the
|
|
39
|
+
* hood. Method signatures match the legacy renderer exactly — the
|
|
40
|
+
* caller can't tell which implementation it's holding.
|
|
41
|
+
*/
|
|
42
|
+
class InkRendererShim extends EventEmitter {
|
|
43
|
+
owner;
|
|
44
|
+
taps = new Set();
|
|
45
|
+
resolveCapture = null;
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
|
+
constructor(owner) {
|
|
48
|
+
super();
|
|
49
|
+
this.owner = owner;
|
|
50
|
+
}
|
|
51
|
+
addEvent(type, content) {
|
|
52
|
+
// Always feed the taps first — they observe the raw event stream
|
|
53
|
+
// even if the type is filtered out of the visible history.
|
|
54
|
+
for (const tap of this.taps) {
|
|
55
|
+
try {
|
|
56
|
+
tap(type, content);
|
|
57
|
+
}
|
|
58
|
+
catch { /* tap errors must not break rendering */ }
|
|
59
|
+
}
|
|
60
|
+
// Thoughts are the model's pre-response reasoning. Showing them as
|
|
61
|
+
// plain chat lines (which my previous map did) leaks "The user
|
|
62
|
+
// just said 'hi' — this is a greeting…" into the visible
|
|
63
|
+
// transcript right above the actual answer. Drop them from the
|
|
64
|
+
// chat surface; debug mode can re-enable later.
|
|
65
|
+
if (type === 'thought' || type === 'streaming')
|
|
66
|
+
return;
|
|
67
|
+
if (type === 'stream') {
|
|
68
|
+
// Coalesce streaming deltas into a single growing assistant
|
|
69
|
+
// message. Pre-fix this rendered "Hi How can I help you today"
|
|
70
|
+
// as one word per line because each delta became its own
|
|
71
|
+
// ChatItem. Now the in-progress message lives in
|
|
72
|
+
// owner._streamingText and renders in a non-Static slot above
|
|
73
|
+
// the prompt; on the next non-stream event (typically the
|
|
74
|
+
// 'response' completion) we commit it as a Static entry.
|
|
75
|
+
this.owner._appendStreamingDelta(content);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (type === 'response') {
|
|
79
|
+
// Streaming is finishing. Replace the in-progress text with the
|
|
80
|
+
// canonical final content (the streamed chunks may have lost
|
|
81
|
+
// formatting under markdown wrapping) and commit to history.
|
|
82
|
+
this.owner._commitStreaming(content);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
// Non-streaming events: a brand-new committed history entry. Also
|
|
86
|
+
// finalises any in-progress streaming message in case the model
|
|
87
|
+
// emitted a tool/system event between deltas.
|
|
88
|
+
this.owner._finalizeStreamingIfAny();
|
|
89
|
+
const kind = EVENT_KIND_MAP[type] ?? 'system';
|
|
90
|
+
this.owner._appendHistoryEntry({ id: `e-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`, kind, text: content });
|
|
91
|
+
}
|
|
92
|
+
addOutputTap(fn) {
|
|
93
|
+
this.taps.add(fn);
|
|
94
|
+
return () => { this.taps.delete(fn); };
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Resolve the next user submission with the typed text. Used by the
|
|
98
|
+
* sudo-password capture flow in interactiveShell.ts.
|
|
99
|
+
*
|
|
100
|
+
* Implementation: stash a resolver, swap the prompt callbacks for one
|
|
101
|
+
* that resolves it, restore on submit. The owner runs setSecretMode
|
|
102
|
+
* around the call site.
|
|
103
|
+
*/
|
|
104
|
+
captureInput(_opts = {}) {
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
this.resolveCapture = resolve;
|
|
107
|
+
this.owner._installCaptureHandler((text) => {
|
|
108
|
+
const trim = _opts.trim !== false;
|
|
109
|
+
const value = trim ? text.trim() : text;
|
|
110
|
+
if (this.resolveCapture) {
|
|
111
|
+
const r = this.resolveCapture;
|
|
112
|
+
this.resolveCapture = null;
|
|
113
|
+
this.owner._restoreSubmitHandler();
|
|
114
|
+
if (_opts.resetBuffer !== false)
|
|
115
|
+
this.owner._setBuffer('');
|
|
116
|
+
r(value);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
clearBuffer() {
|
|
122
|
+
this.owner._setBuffer('');
|
|
123
|
+
}
|
|
124
|
+
setSecretMode(enabled) {
|
|
125
|
+
this.owner._setSecretMode(enabled);
|
|
126
|
+
}
|
|
127
|
+
/** No-op. Ink owns its render loop; manual force is unnecessary. */
|
|
128
|
+
forceRender() { }
|
|
129
|
+
/** Shape parity with the legacy renderer; returns a fixed false. */
|
|
130
|
+
supportsInlinePanel() { return true; }
|
|
131
|
+
/**
|
|
132
|
+
* Used by interactiveShell.ts when re-rendering a tool result after
|
|
133
|
+
* the user expands it. Live update: append a new history entry with
|
|
134
|
+
* the expanded content.
|
|
135
|
+
*/
|
|
136
|
+
expandLastToolResult() { return false; }
|
|
137
|
+
getCollapsedResultCount() { return 0; }
|
|
138
|
+
// Live follow-up queue (Claude Code parity). interactiveShell.ts drives the
|
|
139
|
+
// queue through getRenderer() (this shim), but the state lives on the owning
|
|
140
|
+
// controller — proxy through so the call doesn't throw "is not a function"
|
|
141
|
+
// and crash the shell when a prompt is submitted while the agent is busy.
|
|
142
|
+
setFollowUpQueueMode(on) { this.owner.setFollowUpQueueMode(on); }
|
|
143
|
+
setQueuedPrompts(prompts) { this.owner.setQueuedPrompts(prompts); }
|
|
144
|
+
addUserHistoryItem(text) { this.owner.addUserHistoryItem(text); }
|
|
145
|
+
}
|
|
146
|
+
export class InkPromptController extends EventEmitter {
|
|
147
|
+
callbacks;
|
|
148
|
+
// ink module + App component imported lazily on start() so non-Ink
|
|
149
|
+
// codepaths don't pay the React parse cost.
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
+
inkRender = null;
|
|
152
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
153
|
+
React = null;
|
|
154
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
155
|
+
AppComponent = null;
|
|
156
|
+
inst = null;
|
|
157
|
+
shim = new InkRendererShim(this);
|
|
158
|
+
stdin;
|
|
159
|
+
stdout;
|
|
160
|
+
// In-progress assistant message — accumulates 'stream' deltas. While
|
|
161
|
+
// non-null it renders below <Static> in a regular Ink Box so the text
|
|
162
|
+
// grows in place. Committed to history on 'response' (or finalised
|
|
163
|
+
// when any non-stream event arrives mid-flight).
|
|
164
|
+
streamingText = '';
|
|
165
|
+
// Monotonic suffix for ChatItem ids: Date.now() alone collides when several
|
|
166
|
+
// entries are appended in the same millisecond (e.g. the synchronous /resume
|
|
167
|
+
// replay), producing duplicate React keys in <Static>.
|
|
168
|
+
idSeq = 0;
|
|
169
|
+
// ── live state ────────────────────────────────────────────────
|
|
170
|
+
statusMain = null;
|
|
171
|
+
statusOverride = null;
|
|
172
|
+
statusStreaming = null;
|
|
173
|
+
activityMessage = null;
|
|
174
|
+
mode = 'idle';
|
|
175
|
+
metaInfo = {};
|
|
176
|
+
// ms timestamp the current spinner run began — drives the elapsed counter in
|
|
177
|
+
// StatusLine. Set when the UI transitions into a spinning state, cleared when
|
|
178
|
+
// it stops, so each working run reports its own elapsed time.
|
|
179
|
+
spinStart = null;
|
|
180
|
+
history = [];
|
|
181
|
+
suggestions = [];
|
|
182
|
+
inlinePanel = null;
|
|
183
|
+
secretMode = false;
|
|
184
|
+
editMode = 'display-edits';
|
|
185
|
+
pinnedPrompt = null;
|
|
186
|
+
modeToggleState = {
|
|
187
|
+
autoMode: 'on',
|
|
188
|
+
autoContinueHotkey: '⌥G',
|
|
189
|
+
hitlMode: 'off',
|
|
190
|
+
hitlHotkey: '⌥V',
|
|
191
|
+
};
|
|
192
|
+
buffer = '';
|
|
193
|
+
// Submitted prompts (oldest→newest) for Up/Down shell history navigation.
|
|
194
|
+
promptHistory = [];
|
|
195
|
+
// Workspace files (repo-relative) for @-mention autocomplete.
|
|
196
|
+
completionFiles = [];
|
|
197
|
+
// Set by InkRendererShim.captureInput — temporarily replaces onSubmit.
|
|
198
|
+
captureSubmit = null;
|
|
199
|
+
menuCallback = null;
|
|
200
|
+
menuItems = [];
|
|
201
|
+
// Live follow-up queue (Claude Code parity): when true, the onSubmit wrapper
|
|
202
|
+
// skips appending the user line to permanent <Static> history. The line is
|
|
203
|
+
// shown only in the transient queued region (App) until its turn is dequeued.
|
|
204
|
+
// At dequeue time the shell calls addUserHistoryItem just before processPrompt.
|
|
205
|
+
followUpQueueMode = false;
|
|
206
|
+
queuedPrompts = [];
|
|
207
|
+
menuTitle;
|
|
208
|
+
menuOpen = false;
|
|
209
|
+
started = false;
|
|
210
|
+
disposed = false;
|
|
211
|
+
// Resolves once Ink has finished its async mount (the dynamic ink/react/App
|
|
212
|
+
// imports + first render). Callers that drive events right after start()
|
|
213
|
+
// must await this, or a fast process.exit() can pre-empt the mount and the
|
|
214
|
+
// first frame never reaches stdout (empty-output flake under CPU contention).
|
|
215
|
+
resolveReady;
|
|
216
|
+
readyPromise = new Promise((r) => { this.resolveReady = r; });
|
|
217
|
+
constructor(stdin, stdout, callbacks) {
|
|
218
|
+
super();
|
|
219
|
+
this.stdin = stdin;
|
|
220
|
+
this.stdout = stdout;
|
|
221
|
+
this.callbacks = callbacks;
|
|
222
|
+
}
|
|
223
|
+
// ── lifecycle ─────────────────────────────────────────────────
|
|
224
|
+
/**
|
|
225
|
+
* Async start so the Ink + React modules can be loaded via dynamic
|
|
226
|
+
* import (the dist build emits ESM under `module: NodeNext`, where
|
|
227
|
+
* `require()` mixed with top-level await is a hard error in Node 22+).
|
|
228
|
+
* Call sites that go through createPromptController() should await
|
|
229
|
+
* .start(); the legacy controller's start() is sync, so the IPrompt
|
|
230
|
+
* interface defines start() as `void` and we coerce here.
|
|
231
|
+
*/
|
|
232
|
+
start() { void this.startAsync(); }
|
|
233
|
+
/** Resolves once Ink has mounted and rendered its first frame. */
|
|
234
|
+
whenReady() { return this.readyPromise; }
|
|
235
|
+
async startAsync() {
|
|
236
|
+
if (this.started || this.disposed) {
|
|
237
|
+
this.resolveReady();
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this.started = true;
|
|
241
|
+
try {
|
|
242
|
+
const [ink, react, appMod] = await Promise.all([
|
|
243
|
+
import('ink'),
|
|
244
|
+
import('react'),
|
|
245
|
+
import('./App.js'),
|
|
246
|
+
]);
|
|
247
|
+
this.React = react;
|
|
248
|
+
this.AppComponent = appMod.App;
|
|
249
|
+
this.inkRender = ink.render;
|
|
250
|
+
this.inst = this.inkRender(this.buildTree(), {
|
|
251
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
252
|
+
stdin: this.stdin,
|
|
253
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
254
|
+
stdout: this.stdout,
|
|
255
|
+
// exitOnCtrlC=false so the host's onCtrlC callback fires first.
|
|
256
|
+
exitOnCtrlC: false,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
finally {
|
|
260
|
+
// Always resolve — a waiter must never hang even if mount throws.
|
|
261
|
+
this.resolveReady();
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
stop() {
|
|
265
|
+
if (this.disposed)
|
|
266
|
+
return;
|
|
267
|
+
this.disposed = true;
|
|
268
|
+
this.started = false;
|
|
269
|
+
try {
|
|
270
|
+
this.inst?.unmount();
|
|
271
|
+
}
|
|
272
|
+
catch { /* ignore */ }
|
|
273
|
+
this.inst = null;
|
|
274
|
+
}
|
|
275
|
+
dispose() { this.stop(); }
|
|
276
|
+
/** Manual repaint hook — Ink owns its tick, so render/forceRender are coalesced into a rerender(). */
|
|
277
|
+
render() { this.rerender(); }
|
|
278
|
+
forceRender() { this.rerender(); }
|
|
279
|
+
handleResize() { }
|
|
280
|
+
/**
|
|
281
|
+
* Reset the chat surface (the shell's /clear). Ink's <Static> is
|
|
282
|
+
* append-only — it slices items from an internal index that only grows
|
|
283
|
+
* — so shrinking the history array cannot clear committed scrollback.
|
|
284
|
+
* The only correct reset is to unmount, clear the terminal while Ink is
|
|
285
|
+
* NOT mounted (so the escape can't desync a live render), and remount
|
|
286
|
+
* with empty history; the fresh <Static> restarts at index 0.
|
|
287
|
+
*/
|
|
288
|
+
clearScreen() {
|
|
289
|
+
this.history = [];
|
|
290
|
+
this.streamingText = '';
|
|
291
|
+
if (this.inst && this.inkRender && this.React && this.AppComponent) {
|
|
292
|
+
try {
|
|
293
|
+
this.inst.unmount();
|
|
294
|
+
}
|
|
295
|
+
catch { /* ignore */ }
|
|
296
|
+
this.inst = null;
|
|
297
|
+
// \x1b[3J also drops scrollback so the cleared content can't be scrolled to.
|
|
298
|
+
try {
|
|
299
|
+
this.stdout.write('\x1b[2J\x1b[3J\x1b[H');
|
|
300
|
+
}
|
|
301
|
+
catch { /* ignore */ }
|
|
302
|
+
this.inst = this.inkRender(this.buildTree(), {
|
|
303
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
304
|
+
stdin: this.stdin,
|
|
305
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
306
|
+
stdout: this.stdout,
|
|
307
|
+
exitOnCtrlC: false,
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
else {
|
|
311
|
+
this.rerender();
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
// ── status / activity / streaming ─────────────────────────────
|
|
315
|
+
setStatusMessage(message) { this.statusMain = (message?.trim() || null); this.rerender(); }
|
|
316
|
+
setOverrideStatus(message) { this.statusOverride = (message?.trim() || null); this.rerender(); }
|
|
317
|
+
setStreamingLabel(label) { this.statusStreaming = (label?.trim() || null); this.rerender(); }
|
|
318
|
+
setStatusLine(status) {
|
|
319
|
+
if ('main' in status)
|
|
320
|
+
this.statusMain = status.main?.trim() || null;
|
|
321
|
+
if ('override' in status)
|
|
322
|
+
this.statusOverride = status.override?.trim() || null;
|
|
323
|
+
if ('streaming' in status)
|
|
324
|
+
this.statusStreaming = status.streaming?.trim() || null;
|
|
325
|
+
this.rerender();
|
|
326
|
+
}
|
|
327
|
+
clearAllStatus() {
|
|
328
|
+
this.statusMain = null;
|
|
329
|
+
this.statusOverride = null;
|
|
330
|
+
this.statusStreaming = null;
|
|
331
|
+
this.activityMessage = null;
|
|
332
|
+
this.rerender();
|
|
333
|
+
}
|
|
334
|
+
setActivityMessage(message) { this.activityMessage = message; this.rerender(); }
|
|
335
|
+
setStreaming(streaming) { this.mode = streaming ? 'streaming' : 'idle'; this.rerender(); }
|
|
336
|
+
getMode() { return this.mode; }
|
|
337
|
+
setContextUsage(percentage) {
|
|
338
|
+
if (percentage !== null) {
|
|
339
|
+
this.metaInfo.contextPercent = percentage;
|
|
340
|
+
this.rerender();
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
setMetaStatus(meta) {
|
|
344
|
+
if (typeof meta.elapsedSeconds === 'number' && Number.isFinite(meta.elapsedSeconds) && meta.elapsedSeconds >= 0) {
|
|
345
|
+
const m = Math.floor(meta.elapsedSeconds / 60);
|
|
346
|
+
const s = meta.elapsedSeconds % 60;
|
|
347
|
+
this.metaInfo.sessionTime = `${m}:${s < 10 ? '0' : ''}${s}`;
|
|
348
|
+
}
|
|
349
|
+
if (typeof meta.tokensUsed === 'number' && meta.tokensUsed >= 0) {
|
|
350
|
+
this.metaInfo.tokensUsed = meta.tokensUsed;
|
|
351
|
+
}
|
|
352
|
+
if (meta.tokensUsed != null && meta.tokenLimit != null) {
|
|
353
|
+
this.metaInfo.contextPercent = meta.tokenLimit > 0 ? Math.round((meta.tokensUsed / meta.tokenLimit) * 100) : 0;
|
|
354
|
+
}
|
|
355
|
+
this.rerender();
|
|
356
|
+
}
|
|
357
|
+
setModelContext(options) {
|
|
358
|
+
if (options.model !== undefined)
|
|
359
|
+
this.metaInfo.model = options.model || undefined;
|
|
360
|
+
if (options.provider !== undefined)
|
|
361
|
+
this.metaInfo.provider = options.provider || undefined;
|
|
362
|
+
this.rerender();
|
|
363
|
+
}
|
|
364
|
+
setChromeMeta(meta) {
|
|
365
|
+
if (meta.workspace !== undefined)
|
|
366
|
+
this.metaInfo.workspace = meta.workspace;
|
|
367
|
+
if (meta.directory !== undefined)
|
|
368
|
+
this.metaInfo.directory = meta.directory;
|
|
369
|
+
this.rerender();
|
|
370
|
+
}
|
|
371
|
+
// ── toggles ───────────────────────────────────────────────────
|
|
372
|
+
setModeToggles(options) {
|
|
373
|
+
this.modeToggleState = { ...this.modeToggleState, ...options };
|
|
374
|
+
this.rerender();
|
|
375
|
+
}
|
|
376
|
+
setDebugMode(enabled) { this.modeToggleState.debugEnabled = enabled; this.rerender(); }
|
|
377
|
+
toggleAutoContinue() {
|
|
378
|
+
this.modeToggleState.autoMode = this.modeToggleState.autoMode === 'off' ? 'on' : 'off';
|
|
379
|
+
this.rerender();
|
|
380
|
+
this.callbacks.onToggleAutoContinue?.();
|
|
381
|
+
}
|
|
382
|
+
getAutoMode() { return this.modeToggleState.autoMode; }
|
|
383
|
+
setAutoMode(mode) { this.modeToggleState.autoMode = mode; this.rerender(); }
|
|
384
|
+
toggleHITL() {
|
|
385
|
+
this.modeToggleState.hitlMode = this.modeToggleState.hitlMode === 'off' ? 'on' : 'off';
|
|
386
|
+
this.rerender();
|
|
387
|
+
this.callbacks.onToggleHITL?.();
|
|
388
|
+
}
|
|
389
|
+
getHITLMode() { return this.modeToggleState.hitlMode; }
|
|
390
|
+
getModeToggleState() { return this.modeToggleState; }
|
|
391
|
+
// ── inline panel / pinned prompt / menu / suggestions ──────
|
|
392
|
+
setAvailableCommands(commands) {
|
|
393
|
+
this.suggestions = commands.map((c) => ({ label: c.command, hint: c.description }));
|
|
394
|
+
this.rerender();
|
|
395
|
+
}
|
|
396
|
+
setInlinePanel(lines) { this.inlinePanel = [...lines]; this.rerender(); }
|
|
397
|
+
clearInlinePanel() { this.inlinePanel = null; this.rerender(); }
|
|
398
|
+
supportsInlinePanel() { return true; }
|
|
399
|
+
setPinnedPrompt(text) { this.pinnedPrompt = text; this.rerender(); }
|
|
400
|
+
getPinnedPrompt() { return this.pinnedPrompt; }
|
|
401
|
+
clearPinnedPrompt() { this.pinnedPrompt = null; this.rerender(); }
|
|
402
|
+
setMenu(items, options, callback) {
|
|
403
|
+
this.menuItems = items;
|
|
404
|
+
this.menuCallback = callback;
|
|
405
|
+
this.menuTitle = options.title;
|
|
406
|
+
this.menuOpen = true;
|
|
407
|
+
this.rerender();
|
|
408
|
+
}
|
|
409
|
+
closeMenu() { this.resolveMenu(null); }
|
|
410
|
+
isMenuActive() { return this.menuOpen; }
|
|
411
|
+
/** Close the menu and fire the stored callback exactly once. */
|
|
412
|
+
resolveMenu(item) {
|
|
413
|
+
if (!this.menuOpen)
|
|
414
|
+
return;
|
|
415
|
+
this.menuOpen = false;
|
|
416
|
+
const callback = this.menuCallback;
|
|
417
|
+
this.menuCallback = null;
|
|
418
|
+
this.menuItems = [];
|
|
419
|
+
this.menuTitle = undefined;
|
|
420
|
+
this.rerender();
|
|
421
|
+
if (callback) {
|
|
422
|
+
try {
|
|
423
|
+
callback(item);
|
|
424
|
+
}
|
|
425
|
+
catch { /* selection-handler errors must not break the UI */ }
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
// ── input buffer ──────────────────────────────────────────────
|
|
429
|
+
setSecretMode(enabled) { this.secretMode = enabled; this.rerender(); }
|
|
430
|
+
setEditMode(mode) { this.editMode = mode; this.callbacks.onEditModeChange?.(mode); }
|
|
431
|
+
applyEditMode(mode) { this.setEditMode(mode); }
|
|
432
|
+
getEditMode() { return this.editMode; }
|
|
433
|
+
/**
|
|
434
|
+
* The input buffer in the Ink path is owned by the Prompt component,
|
|
435
|
+
* not by this controller. We keep `this.buffer` as a snapshot for
|
|
436
|
+
* legacy callers asking for getBuffer/getCursor; updates flow when the
|
|
437
|
+
* Prompt's onSubmit / clear actions fire. setBuffer drives a new
|
|
438
|
+
* `initial` prop on the next mount.
|
|
439
|
+
*/
|
|
440
|
+
getBuffer() { return this.buffer; }
|
|
441
|
+
getCursor() { return this.buffer.length; }
|
|
442
|
+
setBuffer(text, _cursorPos) { this.buffer = text; this.rerender(); }
|
|
443
|
+
clear() { this.buffer = ''; this.rerender(); }
|
|
444
|
+
// Live follow-up queue support (see followUpQueueMode comment above)
|
|
445
|
+
setFollowUpQueueMode(on) { this.followUpQueueMode = !!on; this.rerender(); }
|
|
446
|
+
setQueuedPrompts(prompts) { this.queuedPrompts = Array.isArray(prompts) ? prompts.slice() : []; this.rerender(); }
|
|
447
|
+
setCompletionFiles(files) { this.completionFiles = Array.isArray(files) ? files : []; this.rerender(); }
|
|
448
|
+
addUserHistoryItem(text) {
|
|
449
|
+
const t = (text || '').trim();
|
|
450
|
+
if (!t)
|
|
451
|
+
return;
|
|
452
|
+
this.history = [...this.history, { id: `u-${Date.now()}-q-${this.idSeq++}`, kind: 'user', text: t }];
|
|
453
|
+
this.rerender();
|
|
454
|
+
}
|
|
455
|
+
// ── renderer facade ───────────────────────────────────────────
|
|
456
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
457
|
+
getRenderer() { return this.shim; }
|
|
458
|
+
// ── internal ──────────────────────────────────────────────────
|
|
459
|
+
/** Append history (used by the renderer shim's addEvent). */
|
|
460
|
+
_appendHistoryEntry(item) {
|
|
461
|
+
this.history = [...this.history, item];
|
|
462
|
+
this.rerender();
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Streaming accumulators. Deltas append to streamingText, which App
|
|
466
|
+
* renders live as the dynamic region below ChatStatic (<Static>). The
|
|
467
|
+
* old duplication bug — partial text orphaned in scrollback when a
|
|
468
|
+
* Static item appended below it — cannot recur: ChatStatic is the ONLY
|
|
469
|
+
* Static node and renders first, so nothing Static ever appends below
|
|
470
|
+
* the live region, and _commitStreaming pushes history + clears
|
|
471
|
+
* streamingText in a single atomic rerender.
|
|
472
|
+
*/
|
|
473
|
+
_appendStreamingDelta(delta) {
|
|
474
|
+
this.streamingText = (this.streamingText || '') + (delta || '');
|
|
475
|
+
this.rerender();
|
|
476
|
+
}
|
|
477
|
+
_commitStreaming(finalText) {
|
|
478
|
+
// The real delta path ends with addEvent('response', '\n') — the body
|
|
479
|
+
// lives in the accumulated streamingText, NOT in finalText. The
|
|
480
|
+
// non-delta path carries the full text in finalText with an empty
|
|
481
|
+
// streamingText. A tools run emits a "Next steps" addendum as a
|
|
482
|
+
// distinct response. So: commit the buffered body if present, then
|
|
483
|
+
// commit finalText when it is real and not a duplicate of the body.
|
|
484
|
+
const incoming = (finalText || '').trim();
|
|
485
|
+
const buffered = (this.streamingText || '').trim();
|
|
486
|
+
this.streamingText = '';
|
|
487
|
+
const additions = [];
|
|
488
|
+
if (buffered)
|
|
489
|
+
additions.push({ id: `r-${Date.now()}-b-${this.idSeq++}`, kind: 'assistant', text: buffered });
|
|
490
|
+
if (incoming && incoming !== buffered)
|
|
491
|
+
additions.push({ id: `r-${Date.now()}-c-${this.idSeq++}`, kind: 'assistant', text: incoming });
|
|
492
|
+
if (additions.length)
|
|
493
|
+
this.history = [...this.history, ...additions];
|
|
494
|
+
// Single rerender: ChatStatic gains the entries AND the live region
|
|
495
|
+
// (streamingMessage) goes null in the same commit — atomic swap, no
|
|
496
|
+
// duplicate of the streamed body in scrollback.
|
|
497
|
+
this.rerender();
|
|
498
|
+
}
|
|
499
|
+
_finalizeStreamingIfAny() {
|
|
500
|
+
if (!this.streamingText)
|
|
501
|
+
return;
|
|
502
|
+
const text = this.streamingText.trim();
|
|
503
|
+
this.streamingText = '';
|
|
504
|
+
if (text) {
|
|
505
|
+
this.history = [...this.history, { id: `r-${Date.now()}-${this.idSeq++}`, kind: 'assistant', text }];
|
|
506
|
+
}
|
|
507
|
+
// No rerender — the caller is about to push another history entry
|
|
508
|
+
// and rerender once. Avoid the double commit.
|
|
509
|
+
}
|
|
510
|
+
/** Shift+Tab from the Prompt: advance the permission mode and repaint. */
|
|
511
|
+
cyclePermissionModeFromUI() {
|
|
512
|
+
const next = cyclePermissionMode();
|
|
513
|
+
this.rerender();
|
|
514
|
+
this.callbacks.onCyclePermissionMode?.(next);
|
|
515
|
+
}
|
|
516
|
+
_setBuffer(text) { this.buffer = text; this.rerender(); }
|
|
517
|
+
_setSecretMode(enabled) { this.secretMode = enabled; this.rerender(); }
|
|
518
|
+
_installCaptureHandler(handler) { this.captureSubmit = handler; this.rerender(); }
|
|
519
|
+
_restoreSubmitHandler() { this.captureSubmit = null; this.rerender(); }
|
|
520
|
+
rerender() {
|
|
521
|
+
if (!this.inst)
|
|
522
|
+
return;
|
|
523
|
+
try {
|
|
524
|
+
this.inst.rerender(this.buildTree());
|
|
525
|
+
}
|
|
526
|
+
catch { /* swallow rerender races */ }
|
|
527
|
+
}
|
|
528
|
+
buildTree() {
|
|
529
|
+
const composedStatus = this.statusOverride
|
|
530
|
+
|| (this.mode === 'streaming' ? this.statusStreaming : null)
|
|
531
|
+
|| this.activityMessage
|
|
532
|
+
|| this.statusMain;
|
|
533
|
+
const modeChips = this.formatModeChips();
|
|
534
|
+
const spinning = this.mode === 'streaming' || Boolean(this.activityMessage);
|
|
535
|
+
const thinkingGerund = spinning && isGenericThinking(composedStatus);
|
|
536
|
+
// Stamp the start of a working run on the rising edge; clear it when the
|
|
537
|
+
// spinner stops so the next run's elapsed counter restarts from zero.
|
|
538
|
+
if (spinning) {
|
|
539
|
+
if (this.spinStart == null)
|
|
540
|
+
this.spinStart = Date.now();
|
|
541
|
+
}
|
|
542
|
+
else {
|
|
543
|
+
this.spinStart = null;
|
|
544
|
+
}
|
|
545
|
+
return this.React.createElement(this.AppComponent, {
|
|
546
|
+
history: this.history,
|
|
547
|
+
streamingMessage: this.streamingText || null,
|
|
548
|
+
status: {
|
|
549
|
+
message: composedStatus,
|
|
550
|
+
modeMessage: modeChips,
|
|
551
|
+
spinning,
|
|
552
|
+
startTime: this.spinStart,
|
|
553
|
+
tokensUsed: this.metaInfo.tokensUsed ?? null,
|
|
554
|
+
thinkingGerund,
|
|
555
|
+
},
|
|
556
|
+
suggestions: this.suggestions.length ? this.suggestions : undefined,
|
|
557
|
+
inlinePanel: this.inlinePanel && this.inlinePanel.length ? this.inlinePanel : undefined,
|
|
558
|
+
permissionHint: permissionHint(),
|
|
559
|
+
queuedPrompts: this.queuedPrompts.length ? this.queuedPrompts : undefined,
|
|
560
|
+
menu: this.menuOpen ? {
|
|
561
|
+
items: this.menuItems,
|
|
562
|
+
title: this.menuTitle,
|
|
563
|
+
onSelect: (item) => this.resolveMenu(item),
|
|
564
|
+
onCancel: () => this.resolveMenu(null),
|
|
565
|
+
} : undefined,
|
|
566
|
+
prompt: {
|
|
567
|
+
initial: this.buffer,
|
|
568
|
+
secret: this.secretMode,
|
|
569
|
+
onSubmit: (text) => {
|
|
570
|
+
if (this.captureSubmit) {
|
|
571
|
+
this.captureSubmit(text);
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
574
|
+
// Commit the user's submitted text into history before
|
|
575
|
+
// dispatching to the host. The legacy renderer auto-emitted
|
|
576
|
+
// an 'addEvent("prompt", text)' on its own submit path; the
|
|
577
|
+
// Ink path didn't, so submitted prompts vanished from the
|
|
578
|
+
// chat surface. Symptom: user typed "hi", saw the agent
|
|
579
|
+
// respond, but their own "hi" was never in the transcript.
|
|
580
|
+
// Skip secret submissions (passwords) and slash commands —
|
|
581
|
+
// both are interpreted by the host, not user-visible
|
|
582
|
+
// history. Keeps history aligned with what the agent saw.
|
|
583
|
+
//
|
|
584
|
+
// For live follow-up queue (while isProcessing): we *skip* the
|
|
585
|
+
// permanent history append here. The text lives only in the
|
|
586
|
+
// transient queuedPrompts region (App) until the shell dequeues
|
|
587
|
+
// it and calls addUserHistoryItem right before starting its turn.
|
|
588
|
+
// This guarantees response always appears immediately after its
|
|
589
|
+
// triggering user line (correct ordering, no clumping).
|
|
590
|
+
const trimmed = text.trim();
|
|
591
|
+
if (!this.secretMode && trimmed && !trimmed.startsWith('/')) {
|
|
592
|
+
if (!this.followUpQueueMode) {
|
|
593
|
+
this.history = [
|
|
594
|
+
...this.history,
|
|
595
|
+
{ id: `u-${Date.now()}-${this.idSeq++}`, kind: 'user', text: trimmed },
|
|
596
|
+
];
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
// Record into the Up/Down shell history (skip secrets + consecutive
|
|
600
|
+
// dupes; cap to keep it bounded).
|
|
601
|
+
if (!this.secretMode && trimmed && this.promptHistory[this.promptHistory.length - 1] !== trimmed) {
|
|
602
|
+
this.promptHistory.push(trimmed);
|
|
603
|
+
if (this.promptHistory.length > 200)
|
|
604
|
+
this.promptHistory.shift();
|
|
605
|
+
}
|
|
606
|
+
this.buffer = '';
|
|
607
|
+
this.rerender();
|
|
608
|
+
this.callbacks.onSubmit(text);
|
|
609
|
+
},
|
|
610
|
+
onCancel: () => {
|
|
611
|
+
this.callbacks.onCtrlC?.({ hadBuffer: this.buffer.length > 0 });
|
|
612
|
+
this.callbacks.onInterrupt();
|
|
613
|
+
},
|
|
614
|
+
onCyclePermissionMode: () => this.cyclePermissionModeFromUI(),
|
|
615
|
+
onExpandToolResult: () => this.callbacks.onExpandToolResult?.(),
|
|
616
|
+
onEscape: () => this.callbacks.onEscape?.(),
|
|
617
|
+
onShowShortcuts: () => this.callbacks.onShowShortcuts?.(),
|
|
618
|
+
panelOpen: Boolean(this.inlinePanel && this.inlinePanel.length),
|
|
619
|
+
onDismissPanel: () => this.callbacks.onDismissPanel?.(),
|
|
620
|
+
history: this.promptHistory,
|
|
621
|
+
completionFiles: this.completionFiles,
|
|
622
|
+
},
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* The dim mode line under the spinner. Claude Code keeps this minimal and
|
|
627
|
+
* emoji-free: product, model, context left, then active toggles. The cwd and
|
|
628
|
+
* elapsed time deliberately don't live here (cwd is in the welcome box;
|
|
629
|
+
* elapsed rides the spinner).
|
|
630
|
+
*/
|
|
631
|
+
formatModeChips() {
|
|
632
|
+
const parts = ['trenchwork-coder'];
|
|
633
|
+
const meta = this.metaInfo;
|
|
634
|
+
if (meta.model)
|
|
635
|
+
parts.push(meta.model);
|
|
636
|
+
if (meta.contextPercent != null) {
|
|
637
|
+
const left = Math.max(0, 100 - meta.contextPercent);
|
|
638
|
+
parts.push(`${left}% context left`);
|
|
639
|
+
}
|
|
640
|
+
const permChip = permissionStatusChip();
|
|
641
|
+
if (permChip)
|
|
642
|
+
parts.push(permChip);
|
|
643
|
+
if (this.modeToggleState.autoMode === 'on')
|
|
644
|
+
parts.push('auto');
|
|
645
|
+
if (this.modeToggleState.hitlMode === 'on')
|
|
646
|
+
parts.push('HITL');
|
|
647
|
+
if (this.modeToggleState.debugEnabled)
|
|
648
|
+
parts.push('debug');
|
|
649
|
+
if (this.pinnedPrompt)
|
|
650
|
+
parts.push(this.pinnedPrompt.slice(0, 40));
|
|
651
|
+
// The inline panel now renders as its own block (see App.inlinePanel); it
|
|
652
|
+
// no longer leaks its first line into the meta chips.
|
|
653
|
+
return parts.length ? parts.join(' · ') : null;
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Factory — returns the Ink-backed controller. Ink is now the only
|
|
658
|
+
* renderer; the legacy UnifiedUIRenderer + PromptController have been
|
|
659
|
+
* removed. interactiveShell.ts exits early on non-TTY so Ink's
|
|
660
|
+
* raw-mode requirement is always satisfied here. Plain mode
|
|
661
|
+
* (NO_COLOR / TERM=dumb) still flows through Ink — Ink itself
|
|
662
|
+
* down-styles when colours are disabled.
|
|
663
|
+
*/
|
|
664
|
+
export async function createPromptController(stdin, stdout, callbacks) {
|
|
665
|
+
return new InkPromptController(stdin, stdout, callbacks);
|
|
666
|
+
}
|
|
667
|
+
//# sourceMappingURL=InkPromptController.js.map
|