@trenchwork/erosolar 1.1.30 → 1.1.31
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.
Potentially problematic release.
This version of @trenchwork/erosolar might be problematic. Click here for more details.
- package/README.md +6 -6
- package/SECURITY.md +4 -4
- package/dist/bin/cliMode.d.ts +8 -0
- package/dist/bin/cliMode.d.ts.map +1 -0
- package/dist/bin/cliMode.js +20 -0
- package/dist/bin/cliMode.js.map +1 -0
- package/dist/bin/deepseek.d.ts +3 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +332 -0
- package/dist/bin/deepseek.js.map +1 -0
- package/dist/bin/erosolar.d.ts +7 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +7 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/bin/selfTest.d.ts +14 -0
- package/dist/bin/selfTest.d.ts.map +1 -0
- package/dist/bin/selfTest.js +298 -0
- package/dist/bin/selfTest.js.map +1 -0
- package/dist/capabilities/_processRunner.d.ts +17 -0
- package/dist/capabilities/_processRunner.d.ts.map +1 -0
- package/dist/capabilities/_processRunner.js +74 -0
- package/dist/capabilities/_processRunner.js.map +1 -0
- package/dist/capabilities/aflppCapability.d.ts +7 -0
- package/dist/capabilities/aflppCapability.d.ts.map +1 -0
- package/dist/capabilities/aflppCapability.js +301 -0
- package/dist/capabilities/aflppCapability.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/binaryAnalysisCapability.d.ts +7 -0
- package/dist/capabilities/binaryAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/binaryAnalysisCapability.js +201 -0
- package/dist/capabilities/binaryAnalysisCapability.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/engagementCapability.d.ts +15 -0
- package/dist/capabilities/engagementCapability.d.ts.map +1 -0
- package/dist/capabilities/engagementCapability.js +29 -0
- package/dist/capabilities/engagementCapability.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/gdbCapability.d.ts +7 -0
- package/dist/capabilities/gdbCapability.d.ts.map +1 -0
- package/dist/capabilities/gdbCapability.js +125 -0
- package/dist/capabilities/gdbCapability.js.map +1 -0
- package/dist/capabilities/ghidraHeadlessCapability.d.ts +25 -0
- package/dist/capabilities/ghidraHeadlessCapability.d.ts.map +1 -0
- package/dist/capabilities/ghidraHeadlessCapability.js +593 -0
- package/dist/capabilities/ghidraHeadlessCapability.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 +25 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +30 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/interactionCapability.d.ts +6 -0
- package/dist/capabilities/interactionCapability.d.ts.map +1 -0
- package/dist/capabilities/interactionCapability.js +17 -0
- package/dist/capabilities/interactionCapability.js.map +1 -0
- package/dist/capabilities/kaliCapability.d.ts +14 -0
- package/dist/capabilities/kaliCapability.d.ts.map +1 -0
- package/dist/capabilities/kaliCapability.js +478 -0
- package/dist/capabilities/kaliCapability.js.map +1 -0
- package/dist/capabilities/mcpCapability.d.ts +7 -0
- package/dist/capabilities/mcpCapability.d.ts.map +1 -0
- package/dist/capabilities/mcpCapability.js +82 -0
- package/dist/capabilities/mcpCapability.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/monitorCapability.d.ts +6 -0
- package/dist/capabilities/monitorCapability.d.ts.map +1 -0
- package/dist/capabilities/monitorCapability.js +19 -0
- package/dist/capabilities/monitorCapability.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/planModeCapability.d.ts +6 -0
- package/dist/capabilities/planModeCapability.d.ts.map +1 -0
- package/dist/capabilities/planModeCapability.js +16 -0
- package/dist/capabilities/planModeCapability.js.map +1 -0
- package/dist/capabilities/pwntoolsCapability.d.ts +7 -0
- package/dist/capabilities/pwntoolsCapability.d.ts.map +1 -0
- package/dist/capabilities/pwntoolsCapability.js +109 -0
- package/dist/capabilities/pwntoolsCapability.js.map +1 -0
- package/dist/capabilities/scheduleCapability.d.ts +6 -0
- package/dist/capabilities/scheduleCapability.d.ts.map +1 -0
- package/dist/capabilities/scheduleCapability.js +16 -0
- package/dist/capabilities/scheduleCapability.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/triggerCapability.d.ts +6 -0
- package/dist/capabilities/triggerCapability.d.ts.map +1 -0
- package/dist/capabilities/triggerCapability.js +16 -0
- package/dist/capabilities/triggerCapability.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 +788 -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/capabilities/worktreeCapability.d.ts +6 -0
- package/dist/capabilities/worktreeCapability.d.ts.map +1 -0
- package/dist/capabilities/worktreeCapability.js +16 -0
- package/dist/capabilities/worktreeCapability.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +155 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/v1/agent.d.ts +179 -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/agent.d.ts +320 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1627 -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/artifactStore.d.ts +35 -0
- package/dist/core/artifactStore.d.ts.map +1 -0
- package/dist/core/artifactStore.js +105 -0
- package/dist/core/artifactStore.js.map +1 -0
- package/dist/core/auth.d.ts +15 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +345 -0
- package/dist/core/auth.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/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 +1073 -0
- package/dist/core/contextManager.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 +123 -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/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 +271 -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/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 +387 -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 +239 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.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 +105 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +768 -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/preferences.d.ts +65 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +305 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/projectTracker.d.ts +96 -0
- package/dist/core/projectTracker.d.ts.map +1 -0
- package/dist/core/projectTracker.js +275 -0
- package/dist/core/projectTracker.js.map +1 -0
- package/dist/core/providerKeys.d.ts +20 -0
- package/dist/core/providerKeys.d.ts.map +1 -0
- package/dist/core/providerKeys.js +40 -0
- package/dist/core/providerKeys.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/resultVerification.d.ts +47 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +126 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/reviewerGuard.d.ts +37 -0
- package/dist/core/reviewerGuard.d.ts.map +1 -0
- package/dist/core/reviewerGuard.js +188 -0
- package/dist/core/reviewerGuard.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 +48 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +259 -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 +191 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/sharedSecrets.d.ts +60 -0
- package/dist/core/sharedSecrets.d.ts.map +1 -0
- package/dist/core/sharedSecrets.js +111 -0
- package/dist/core/sharedSecrets.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/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/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 +192 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +511 -0
- package/dist/core/toolRuntime.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 +599 -0
- package/dist/core/updateChecker.js.map +1 -0
- package/dist/core/usageTracker.d.ts +11 -0
- package/dist/core/usageTracker.d.ts.map +1 -0
- package/dist/core/usageTracker.js +128 -0
- package/dist/core/usageTracker.js.map +1 -0
- package/dist/core/userApproval.d.ts +95 -0
- package/dist/core/userApproval.d.ts.map +1 -0
- package/dist/core/userApproval.js +239 -0
- package/dist/core/userApproval.js.map +1 -0
- package/dist/headless/interactiveShell.d.ts +22 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +2156 -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/index.d.ts +49 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +104 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +9 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +48 -0
- package/dist/plugins/providers/anthropic/index.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +11 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +54 -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 +17 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +10 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +47 -0
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +10 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +47 -0
- package/dist/plugins/providers/xai/index.js.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +10 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +110 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +14 -0
- package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts +9 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.js +15 -0
- package/dist/plugins/tools/edit/editPlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +9 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +14 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +3 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +9 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +3 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts +3 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js +31 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js.map +1 -0
- package/dist/plugins/tools/kali/kaliPlugin.d.ts +3 -0
- package/dist/plugins/tools/kali/kaliPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/kali/kaliPlugin.js +10 -0
- package/dist/plugins/tools/kali/kaliPlugin.js.map +1 -0
- package/dist/plugins/tools/mcp/mcpClient.d.ts +59 -0
- package/dist/plugins/tools/mcp/mcpClient.d.ts.map +1 -0
- package/dist/plugins/tools/mcp/mcpClient.js +118 -0
- package/dist/plugins/tools/mcp/mcpClient.js.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts +3 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js +10 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +13 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +37 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +3 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +340 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +58 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +14 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts +3 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.js +27 -0
- package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
- package/dist/plugins/tools/todo/todoPlugin.d.ts +3 -0
- package/dist/plugins/tools/todo/todoPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/todo/todoPlugin.js +10 -0
- package/dist/plugins/tools/todo/todoPlugin.js.map +1 -0
- package/dist/providers/baseProvider.d.ts +148 -0
- package/dist/providers/baseProvider.d.ts.map +1 -0
- package/dist/providers/baseProvider.js +284 -0
- package/dist/providers/baseProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +64 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1018 -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 +103 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +468 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +121 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +739 -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 +23 -0
- package/dist/runtime/agentSpawningWiring.d.ts.map +1 -0
- package/dist/runtime/agentSpawningWiring.js +119 -0
- package/dist/runtime/agentSpawningWiring.js.map +1 -0
- package/dist/runtime/agentWorkerPool.d.ts +167 -0
- package/dist/runtime/agentWorkerPool.d.ts.map +1 -0
- package/dist/runtime/agentWorkerPool.js +435 -0
- package/dist/runtime/agentWorkerPool.js.map +1 -0
- package/dist/runtime/node.d.ts +9 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +56 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/profileGates.d.ts +19 -0
- package/dist/runtime/profileGates.d.ts.map +1 -0
- package/dist/runtime/profileGates.js +23 -0
- package/dist/runtime/profileGates.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 +31 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/autoExecutor.d.ts +70 -0
- package/dist/shell/autoExecutor.d.ts.map +1 -0
- package/dist/shell/autoExecutor.js +320 -0
- package/dist/shell/autoExecutor.js.map +1 -0
- package/dist/shell/commandRegistry.d.ts +122 -0
- package/dist/shell/commandRegistry.d.ts.map +1 -0
- package/dist/shell/commandRegistry.js +355 -0
- package/dist/shell/commandRegistry.js.map +1 -0
- package/dist/shell/composableMessage.d.ts +178 -0
- package/dist/shell/composableMessage.d.ts.map +1 -0
- package/dist/shell/composableMessage.js +384 -0
- package/dist/shell/composableMessage.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/vimMode.d.ts +66 -0
- package/dist/shell/vimMode.d.ts.map +1 -0
- package/dist/shell/vimMode.js +435 -0
- package/dist/shell/vimMode.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 +779 -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/engagementTools.d.ts +22 -0
- package/dist/tools/engagementTools.d.ts.map +1 -0
- package/dist/tools/engagementTools.js +339 -0
- package/dist/tools/engagementTools.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 +128 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/heliaControl.d.ts +51 -0
- package/dist/tools/heliaControl.d.ts.map +1 -0
- package/dist/tools/heliaControl.js +93 -0
- package/dist/tools/heliaControl.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/interactionTools.d.ts +16 -0
- package/dist/tools/interactionTools.d.ts.map +1 -0
- package/dist/tools/interactionTools.js +207 -0
- package/dist/tools/interactionTools.js.map +1 -0
- package/dist/tools/localExplore.d.ts +38 -0
- package/dist/tools/localExplore.d.ts.map +1 -0
- package/dist/tools/localExplore.js +30 -0
- package/dist/tools/localExplore.js.map +1 -0
- package/dist/tools/memoryTools.d.ts +20 -0
- package/dist/tools/memoryTools.d.ts.map +1 -0
- package/dist/tools/memoryTools.js +180 -0
- package/dist/tools/memoryTools.js.map +1 -0
- package/dist/tools/monitorTools.d.ts +16 -0
- package/dist/tools/monitorTools.d.ts.map +1 -0
- package/dist/tools/monitorTools.js +178 -0
- package/dist/tools/monitorTools.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/planModeTools.d.ts +32 -0
- package/dist/tools/planModeTools.d.ts.map +1 -0
- package/dist/tools/planModeTools.js +200 -0
- package/dist/tools/planModeTools.js.map +1 -0
- package/dist/tools/scheduleTools.d.ts +39 -0
- package/dist/tools/scheduleTools.d.ts.map +1 -0
- package/dist/tools/scheduleTools.js +182 -0
- package/dist/tools/scheduleTools.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 +413 -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 +24 -0
- package/dist/tools/todoTools.d.ts.map +1 -0
- package/dist/tools/todoTools.js +115 -0
- package/dist/tools/todoTools.js.map +1 -0
- package/dist/tools/triggerTools.d.ts +28 -0
- package/dist/tools/triggerTools.d.ts.map +1 -0
- package/dist/tools/triggerTools.js +210 -0
- package/dist/tools/triggerTools.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 +332 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/tools/worktreeTools.d.ts +21 -0
- package/dist/tools/worktreeTools.d.ts.map +1 -0
- package/dist/tools/worktreeTools.js +158 -0
- package/dist/tools/worktreeTools.js.map +1 -0
- package/dist/ui/RenderGate.d.ts +83 -0
- package/dist/ui/RenderGate.d.ts.map +1 -0
- package/dist/ui/RenderGate.js +138 -0
- package/dist/ui/RenderGate.js.map +1 -0
- package/dist/ui/animatedStatus.d.ts +140 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -0
- package/dist/ui/animatedStatus.js +480 -0
- package/dist/ui/animatedStatus.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +197 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +440 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +855 -0
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +114 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/errorFormatter.d.ts +64 -0
- package/dist/ui/errorFormatter.d.ts.map +1 -0
- package/dist/ui/errorFormatter.js +316 -0
- package/dist/ui/errorFormatter.js.map +1 -0
- package/dist/ui/globalWriteLock.d.ts +63 -0
- package/dist/ui/globalWriteLock.d.ts.map +1 -0
- package/dist/ui/globalWriteLock.js +173 -0
- package/dist/ui/globalWriteLock.js.map +1 -0
- package/dist/ui/index.d.ts +31 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +49 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/ink/App.d.ts +39 -0
- package/dist/ui/ink/App.d.ts.map +1 -0
- package/dist/ui/ink/App.js +19 -0
- package/dist/ui/ink/App.js.map +1 -0
- package/dist/ui/ink/ChatStatic.d.ts +29 -0
- package/dist/ui/ink/ChatStatic.d.ts.map +1 -0
- package/dist/ui/ink/ChatStatic.js +31 -0
- package/dist/ui/ink/ChatStatic.js.map +1 -0
- package/dist/ui/ink/InkPromptController.d.ts +286 -0
- package/dist/ui/ink/InkPromptController.d.ts.map +1 -0
- package/dist/ui/ink/InkPromptController.js +558 -0
- package/dist/ui/ink/InkPromptController.js.map +1 -0
- package/dist/ui/ink/Prompt.d.ts +36 -0
- package/dist/ui/ink/Prompt.d.ts.map +1 -0
- package/dist/ui/ink/Prompt.js +296 -0
- package/dist/ui/ink/Prompt.js.map +1 -0
- package/dist/ui/ink/StatusLine.d.ts +25 -0
- package/dist/ui/ink/StatusLine.d.ts.map +1 -0
- package/dist/ui/ink/StatusLine.js +12 -0
- package/dist/ui/ink/StatusLine.js.map +1 -0
- package/dist/ui/ink/adapter.d.ts +58 -0
- package/dist/ui/ink/adapter.d.ts.map +1 -0
- package/dist/ui/ink/adapter.js +113 -0
- package/dist/ui/ink/adapter.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +157 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +501 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +27 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +184 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/outputMode.d.ts +58 -0
- package/dist/ui/outputMode.d.ts.map +1 -0
- package/dist/ui/outputMode.js +179 -0
- package/dist/ui/outputMode.js.map +1 -0
- package/dist/ui/overlay/OverlayManager.d.ts +105 -0
- package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
- package/dist/ui/overlay/OverlayManager.js +304 -0
- package/dist/ui/overlay/OverlayManager.js.map +1 -0
- package/dist/ui/premiumComponents.d.ts +54 -0
- package/dist/ui/premiumComponents.d.ts.map +1 -0
- package/dist/ui/premiumComponents.js +241 -0
- package/dist/ui/premiumComponents.js.map +1 -0
- package/dist/ui/richText.d.ts +13 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +444 -0
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.js +60 -0
- package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/textHighlighter.d.ts +83 -0
- package/dist/ui/textHighlighter.d.ts.map +1 -0
- package/dist/ui/textHighlighter.js +267 -0
- package/dist/ui/textHighlighter.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 +436 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/toolDisplay.d.ts +221 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -0
- package/dist/ui/toolDisplay.js +1654 -0
- package/dist/ui/toolDisplay.js.map +1 -0
- package/dist/ui/uiConstants.d.ts +253 -0
- package/dist/ui/uiConstants.d.ts.map +1 -0
- package/dist/ui/uiConstants.js +437 -0
- package/dist/ui/uiConstants.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/askUserPrompt.d.ts +21 -0
- package/dist/utils/askUserPrompt.d.ts.map +1 -0
- package/dist/utils/askUserPrompt.js +87 -0
- package/dist/utils/askUserPrompt.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/lambdaClient.d.ts +35 -0
- package/dist/utils/lambdaClient.d.ts.map +1 -0
- package/dist/utils/lambdaClient.js +81 -0
- package/dist/utils/lambdaClient.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/projectRegistration.d.ts +61 -0
- package/dist/utils/projectRegistration.d.ts.map +1 -0
- package/dist/utils/projectRegistration.js +212 -0
- package/dist/utils/projectRegistration.js.map +1 -0
- package/dist/utils/securityUtils.d.ts +145 -0
- package/dist/utils/securityUtils.d.ts.map +1 -0
- package/dist/utils/securityUtils.js +507 -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 +1 -1
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal CLI-side client for the Erosolar AWS Lambda callable surface.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the `httpsCallable` envelope used by the portal:
|
|
5
|
+
* POST <API_BASE>/callable/<name>
|
|
6
|
+
* Authorization: Bearer <Firebase ID token>
|
|
7
|
+
* { data: ... }
|
|
8
|
+
*
|
|
9
|
+
* Used by the cron / webhook / HITL tools so they can talk to the same
|
|
10
|
+
* Lambda + Firestore the portal does. Auth is best-effort: if the user
|
|
11
|
+
* has not signed in, callable requests fail with a clear message rather
|
|
12
|
+
* than throwing — the calling tool decides whether the missing auth is
|
|
13
|
+
* fatal or fallback-able.
|
|
14
|
+
*/
|
|
15
|
+
export declare const LAMBDA_API_BASE = "https://cfqeqx4lt9.execute-api.us-east-1.amazonaws.com";
|
|
16
|
+
export interface LambdaCallResult<T> {
|
|
17
|
+
ok: boolean;
|
|
18
|
+
status?: number;
|
|
19
|
+
result?: T;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|
|
22
|
+
interface CachedAuth {
|
|
23
|
+
uid?: string;
|
|
24
|
+
token?: string;
|
|
25
|
+
tokenExpiresAt?: number;
|
|
26
|
+
refreshToken?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare function readCliAuth(): CachedAuth | null;
|
|
29
|
+
export declare function callLambda<T = unknown>(name: string, data: Record<string, unknown> | undefined, options?: {
|
|
30
|
+
signal?: AbortSignal;
|
|
31
|
+
baseUrl?: string;
|
|
32
|
+
timeoutMs?: number;
|
|
33
|
+
}): Promise<LambdaCallResult<T>>;
|
|
34
|
+
export {};
|
|
35
|
+
//# sourceMappingURL=lambdaClient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambdaClient.d.ts","sourceRoot":"","sources":["../../src/utils/lambdaClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,eAAO,MAAM,eAAe,2DAA2D,CAAC;AAExF,MAAM,WAAW,gBAAgB,CAAC,CAAC;IACjC,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,CAAC,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,UAAU,UAAU;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,wBAAgB,WAAW,IAAI,UAAU,GAAG,IAAI,CAO/C;AASD,wBAAsB,UAAU,CAAC,CAAC,GAAG,OAAO,EAC1C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAO,GAC3E,OAAO,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAqC9B"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal CLI-side client for the Erosolar AWS Lambda callable surface.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the `httpsCallable` envelope used by the portal:
|
|
5
|
+
* POST <API_BASE>/callable/<name>
|
|
6
|
+
* Authorization: Bearer <Firebase ID token>
|
|
7
|
+
* { data: ... }
|
|
8
|
+
*
|
|
9
|
+
* Used by the cron / webhook / HITL tools so they can talk to the same
|
|
10
|
+
* Lambda + Firestore the portal does. Auth is best-effort: if the user
|
|
11
|
+
* has not signed in, callable requests fail with a clear message rather
|
|
12
|
+
* than throwing — the calling tool decides whether the missing auth is
|
|
13
|
+
* fatal or fallback-able.
|
|
14
|
+
*/
|
|
15
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
16
|
+
import { homedir } from 'node:os';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
export const LAMBDA_API_BASE = 'https://cfqeqx4lt9.execute-api.us-east-1.amazonaws.com';
|
|
19
|
+
const AUTH_FILE = join(homedir(), '.erosolar', 'auth.json');
|
|
20
|
+
export function readCliAuth() {
|
|
21
|
+
if (!existsSync(AUTH_FILE))
|
|
22
|
+
return null;
|
|
23
|
+
try {
|
|
24
|
+
return JSON.parse(readFileSync(AUTH_FILE, 'utf-8'));
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function tokenLooksFresh(state) {
|
|
31
|
+
if (!state?.token)
|
|
32
|
+
return false;
|
|
33
|
+
if (typeof state.tokenExpiresAt !== 'number')
|
|
34
|
+
return true;
|
|
35
|
+
// 60s safety margin so we don't burn a request on an about-to-expire token.
|
|
36
|
+
return Date.now() + 60_000 < state.tokenExpiresAt;
|
|
37
|
+
}
|
|
38
|
+
export async function callLambda(name, data, options = {}) {
|
|
39
|
+
const auth = readCliAuth();
|
|
40
|
+
const headers = { 'content-type': 'application/json' };
|
|
41
|
+
if (tokenLooksFresh(auth)) {
|
|
42
|
+
headers.authorization = `Bearer ${auth.token}`;
|
|
43
|
+
}
|
|
44
|
+
const controller = new AbortController();
|
|
45
|
+
const timeout = options.timeoutMs ?? 15_000;
|
|
46
|
+
const timer = setTimeout(() => controller.abort(), timeout);
|
|
47
|
+
if (options.signal) {
|
|
48
|
+
options.signal.addEventListener('abort', () => controller.abort(), { once: true });
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const baseUrl = options.baseUrl ?? LAMBDA_API_BASE;
|
|
52
|
+
const res = await fetch(`${baseUrl}/callable/${name}`, {
|
|
53
|
+
method: 'POST',
|
|
54
|
+
headers,
|
|
55
|
+
body: JSON.stringify({ data: data ?? {} }),
|
|
56
|
+
signal: controller.signal,
|
|
57
|
+
});
|
|
58
|
+
let body = null;
|
|
59
|
+
try {
|
|
60
|
+
body = await res.json();
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
body = null;
|
|
64
|
+
}
|
|
65
|
+
if (!res.ok) {
|
|
66
|
+
return {
|
|
67
|
+
ok: false,
|
|
68
|
+
status: res.status,
|
|
69
|
+
error: body?.error?.message || `HTTP ${res.status}`,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
return { ok: true, status: res.status, result: body?.result };
|
|
73
|
+
}
|
|
74
|
+
catch (err) {
|
|
75
|
+
return { ok: false, error: err instanceof Error ? err.message : String(err) };
|
|
76
|
+
}
|
|
77
|
+
finally {
|
|
78
|
+
clearTimeout(timer);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=lambdaClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lambdaClient.js","sourceRoot":"","sources":["../../src/utils/lambdaClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,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,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC;IAChF,CAAC;YAAS,CAAC;QACT,YAAY,CAAC,KAAK,CAAC,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PackageInfo {
|
|
2
|
+
name?: string;
|
|
3
|
+
version?: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Locate and read the nearest package.json starting from the caller's module URL.
|
|
7
|
+
* This mirrors prior per-file helpers but centralizes the logic so CLI entrypoints
|
|
8
|
+
* and tests stay consistent even if their relative paths change.
|
|
9
|
+
*/
|
|
10
|
+
export declare function readPackageInfo(importMetaUrl: string | URL, options?: {
|
|
11
|
+
maxDepth?: number;
|
|
12
|
+
}): PackageInfo;
|
|
13
|
+
export declare function readPackageVersion(importMetaUrl: string | URL, fallback?: string): string;
|
|
14
|
+
//# sourceMappingURL=packageInfo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageInfo.d.ts","sourceRoot":"","sources":["../../src/utils/packageInfo.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,aAAa,EAAE,MAAM,GAAG,GAAG,EAC3B,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC9B,WAAW,CAiBb;AAED,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,MAAM,GAAG,GAAG,EAAE,QAAQ,SAAU,GAAG,MAAM,CAE1F"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, resolve } from 'node:path';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
/**
|
|
5
|
+
* Locate and read the nearest package.json starting from the caller's module URL.
|
|
6
|
+
* This mirrors prior per-file helpers but centralizes the logic so CLI entrypoints
|
|
7
|
+
* and tests stay consistent even if their relative paths change.
|
|
8
|
+
*/
|
|
9
|
+
export function readPackageInfo(importMetaUrl, options) {
|
|
10
|
+
const maxDepth = options?.maxDepth ?? 6;
|
|
11
|
+
const startDir = dirname(fileURLToPath(importMetaUrl));
|
|
12
|
+
const packagePath = findNearestPackageJson(startDir, maxDepth);
|
|
13
|
+
if (!packagePath) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
try {
|
|
17
|
+
const payload = JSON.parse(readFileSync(packagePath, 'utf8'));
|
|
18
|
+
return {
|
|
19
|
+
name: typeof payload.name === 'string' ? payload.name : undefined,
|
|
20
|
+
version: typeof payload.version === 'string' ? payload.version : undefined,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return {};
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
export function readPackageVersion(importMetaUrl, fallback = '0.0.0') {
|
|
28
|
+
return readPackageInfo(importMetaUrl).version ?? fallback;
|
|
29
|
+
}
|
|
30
|
+
function findNearestPackageJson(startDir, maxDepth) {
|
|
31
|
+
let current = startDir;
|
|
32
|
+
for (let depth = 0; depth <= maxDepth; depth += 1) {
|
|
33
|
+
const candidate = resolve(current, 'package.json');
|
|
34
|
+
if (existsSync(candidate)) {
|
|
35
|
+
return candidate;
|
|
36
|
+
}
|
|
37
|
+
const parent = dirname(current);
|
|
38
|
+
if (parent === current) {
|
|
39
|
+
break;
|
|
40
|
+
}
|
|
41
|
+
current = parent;
|
|
42
|
+
}
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=packageInfo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packageInfo.js","sourceRoot":"","sources":["../../src/utils/packageInfo.ts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GAAG,CAAC,EAAE,KAAK,IAAI,QAAQ,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QACnD,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACnB,CAAC;QACD,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;YACvB,MAAM;QACR,CAAC;QACD,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type PlanStatus = 'pending' | 'in_progress' | 'completed';
|
|
2
|
+
export interface PlanItem {
|
|
3
|
+
step: string;
|
|
4
|
+
status?: PlanStatus;
|
|
5
|
+
}
|
|
6
|
+
export type NormalizedPlanItem = PlanItem & {
|
|
7
|
+
status: PlanStatus;
|
|
8
|
+
};
|
|
9
|
+
export type PlanInput = Array<PlanItem | string | number | boolean | null | undefined>;
|
|
10
|
+
export interface PlanFormatOptions {
|
|
11
|
+
heading?: string;
|
|
12
|
+
bullet?: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
statusSymbols?: Partial<Record<PlanStatus, string>>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Format a structured plan for display with compact tree-like layout.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatPlan(plan: PlanInput, options?: PlanFormatOptions): string;
|
|
20
|
+
export declare function formatPlan(plan: unknown, options?: PlanFormatOptions): string;
|
|
21
|
+
/**
|
|
22
|
+
* Normalize plan input into a typed list of steps with default statuses.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizePlanItems(plan: PlanInput): NormalizedPlanItem[];
|
|
25
|
+
export declare function normalizePlanItems(plan: unknown): NormalizedPlanItem[];
|
|
26
|
+
/**
|
|
27
|
+
* Wrap plan text with a prefix, preserving indentation for continuations.
|
|
28
|
+
*/
|
|
29
|
+
export declare function wrapPlanText(text: string, prefix: string, width?: number): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Determine the available plan width using the terminal size if available.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolvePlanWidth(padding?: number): number | undefined;
|
|
34
|
+
//# sourceMappingURL=planFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planFormatter.d.ts","sourceRoot":"","sources":["../../src/utils/planFormatter.ts"],"names":[],"mappings":"AAMA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAEjE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAEvF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAuB/E;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,kBAAkB,EAAE,CAAC;AAC1E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAAC;AAyCxE;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAanF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,MAAU,GAAG,MAAM,GAAG,SAAS,CASxE"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// eslint-disable-next-line no-control-regex
|
|
2
|
+
const ANSI_REGEX = /\u001B\[[0-9;]*m/g;
|
|
3
|
+
const DEFAULT_WIDTH = 78;
|
|
4
|
+
const MIN_WIDTH = 42;
|
|
5
|
+
const MAX_WIDTH = 100;
|
|
6
|
+
export function formatPlan(plan, options = {}) {
|
|
7
|
+
const width = clampWidth(options.width);
|
|
8
|
+
const heading = (options.heading ?? 'Updated Plan').trim() || 'Updated Plan';
|
|
9
|
+
const bullet = (options.bullet ?? '•').trim() || '•';
|
|
10
|
+
const items = normalizePlanItems(plan);
|
|
11
|
+
const lines = [`${bullet} ${heading}`];
|
|
12
|
+
if (!items.length) {
|
|
13
|
+
lines.push(' (no steps provided)');
|
|
14
|
+
return lines.join('\n');
|
|
15
|
+
}
|
|
16
|
+
const statusSymbols = buildStatusSymbols(options.statusSymbols);
|
|
17
|
+
items.forEach((item, index) => {
|
|
18
|
+
const prefix = `${index === 0 ? ' └ ' : ' '}${statusSymbols[item.status]} `;
|
|
19
|
+
lines.push(...wrapPlanText(item.step, prefix, width));
|
|
20
|
+
});
|
|
21
|
+
return lines.join('\n');
|
|
22
|
+
}
|
|
23
|
+
export function normalizePlanItems(plan) {
|
|
24
|
+
if (!Array.isArray(plan)) {
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
const items = [];
|
|
28
|
+
for (const entry of plan) {
|
|
29
|
+
if (entry === null || entry === undefined) {
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
if (typeof entry === 'string' || typeof entry === 'number' || typeof entry === 'boolean') {
|
|
33
|
+
const step = String(entry).trim();
|
|
34
|
+
if (!step) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
items.push({ step, status: 'pending' });
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (typeof entry === 'object') {
|
|
41
|
+
const rawStep = entry.step;
|
|
42
|
+
const step = typeof rawStep === 'string'
|
|
43
|
+
? rawStep.trim()
|
|
44
|
+
: typeof rawStep === 'number' || typeof rawStep === 'boolean'
|
|
45
|
+
? String(rawStep).trim()
|
|
46
|
+
: '';
|
|
47
|
+
if (!step) {
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const status = normalizeStatus(entry.status);
|
|
51
|
+
items.push({ step, status });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return items;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Wrap plan text with a prefix, preserving indentation for continuations.
|
|
58
|
+
*/
|
|
59
|
+
export function wrapPlanText(text, prefix, width) {
|
|
60
|
+
const normalizedWidth = clampWidth(width);
|
|
61
|
+
const cleanPrefix = prefix ?? '';
|
|
62
|
+
const prefixLength = visibleLength(cleanPrefix);
|
|
63
|
+
const available = Math.max(12, normalizedWidth - prefixLength);
|
|
64
|
+
const wrapped = wrapText(text, available);
|
|
65
|
+
if (!wrapped.length) {
|
|
66
|
+
return [cleanPrefix.trimEnd()];
|
|
67
|
+
}
|
|
68
|
+
const indent = ' '.repeat(prefixLength);
|
|
69
|
+
return wrapped.map((line, index) => (index === 0 ? `${cleanPrefix}${line}` : `${indent}${line}`));
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Determine the available plan width using the terminal size if available.
|
|
73
|
+
*/
|
|
74
|
+
export function resolvePlanWidth(padding = 4) {
|
|
75
|
+
if (typeof process !== 'undefined' &&
|
|
76
|
+
typeof process.stdout?.columns === 'number' &&
|
|
77
|
+
Number.isFinite(process.stdout.columns)) {
|
|
78
|
+
return Math.max(0, process.stdout.columns - padding);
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
function buildStatusSymbols(overrides) {
|
|
83
|
+
return {
|
|
84
|
+
pending: overrides?.pending?.trim() || '□',
|
|
85
|
+
in_progress: overrides?.in_progress?.trim() || '◐',
|
|
86
|
+
completed: overrides?.completed?.trim() || '✔',
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
function normalizeStatus(status) {
|
|
90
|
+
if (typeof status !== 'string') {
|
|
91
|
+
return 'pending';
|
|
92
|
+
}
|
|
93
|
+
const normalized = status.trim().toLowerCase().replace(/[\s-]+/g, '_');
|
|
94
|
+
if (normalized === 'completed' || normalized === 'complete' || normalized === 'done') {
|
|
95
|
+
return 'completed';
|
|
96
|
+
}
|
|
97
|
+
if (normalized === 'in_progress' || normalized === 'inprogress') {
|
|
98
|
+
return 'in_progress';
|
|
99
|
+
}
|
|
100
|
+
return 'pending';
|
|
101
|
+
}
|
|
102
|
+
function wrapText(text, width) {
|
|
103
|
+
const normalized = (text || '').trim();
|
|
104
|
+
if (!normalized) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
const words = normalized.split(/\s+/);
|
|
108
|
+
const lines = [];
|
|
109
|
+
let current = words.shift() ?? '';
|
|
110
|
+
for (const word of words) {
|
|
111
|
+
const candidate = `${current} ${word}`;
|
|
112
|
+
if (visibleLength(candidate) > width && current) {
|
|
113
|
+
lines.push(current);
|
|
114
|
+
current = word;
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
current = candidate;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (current) {
|
|
121
|
+
lines.push(current);
|
|
122
|
+
}
|
|
123
|
+
return lines;
|
|
124
|
+
}
|
|
125
|
+
function clampWidth(width) {
|
|
126
|
+
if (typeof width !== 'number' || !Number.isFinite(width)) {
|
|
127
|
+
return DEFAULT_WIDTH;
|
|
128
|
+
}
|
|
129
|
+
const normalized = Math.floor(width);
|
|
130
|
+
if (normalized < MIN_WIDTH) {
|
|
131
|
+
return MIN_WIDTH;
|
|
132
|
+
}
|
|
133
|
+
if (normalized > MAX_WIDTH) {
|
|
134
|
+
return MAX_WIDTH;
|
|
135
|
+
}
|
|
136
|
+
return normalized;
|
|
137
|
+
}
|
|
138
|
+
function visibleLength(value) {
|
|
139
|
+
return value.replace(ANSI_REGEX, '').length;
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=planFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planFormatter.js","sourceRoot":"","sources":["../../src/utils/planFormatter.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,SAAS,GAAG,GAAG,CAAC;AAwBtB,MAAM,UAAU,UAAU,CAAC,IAAa,EAAE,UAA6B,EAAE;IACvE,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,IAAI,EAAE,IAAI,cAAc,CAAC;IAC7E,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,CAAC;IACrD,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACvC,MAAM,KAAK,GAAa,CAAC,GAAG,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;IAEjD,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;QAClB,KAAK,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC,IAAI,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IACnB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects rendezvous — CLI side.
|
|
3
|
+
*
|
|
4
|
+
* Each workspace the CLI operates in registers a project record at
|
|
5
|
+
* users/<uid>/projects/<projectId> via the cliProjectRegister Lambda
|
|
6
|
+
* callable. The portal renders these as a cross-machine "where am I
|
|
7
|
+
* working" dashboard.
|
|
8
|
+
*
|
|
9
|
+
* Privacy posture:
|
|
10
|
+
* - default coding profile registers full remote URL.
|
|
11
|
+
* - offsec profiles do NOT register by default. Operator can opt in
|
|
12
|
+
* via EROSOLAR_ENABLE_PROJECT_REGISTRATION=1; even then host + owner
|
|
13
|
+
* are masked so target identity does not leak.
|
|
14
|
+
* - any profile can opt out with EROSOLAR_DISABLE_PROJECT_REGISTRATION=1.
|
|
15
|
+
*
|
|
16
|
+
* Best-effort: a failed call never blocks the agent loop.
|
|
17
|
+
*/
|
|
18
|
+
import type { ProfileName } from '../runtime/profileGates.js';
|
|
19
|
+
export interface GitRemoteInfo {
|
|
20
|
+
raw: string;
|
|
21
|
+
host: string | null;
|
|
22
|
+
owner: string | null;
|
|
23
|
+
repo: string | null;
|
|
24
|
+
githubUrl: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface ProjectIdentity {
|
|
27
|
+
projectId: string;
|
|
28
|
+
name: string;
|
|
29
|
+
branch: string | null;
|
|
30
|
+
remote: GitRemoteInfo | null;
|
|
31
|
+
masked: boolean;
|
|
32
|
+
workingDirHash: string;
|
|
33
|
+
hostname: string;
|
|
34
|
+
profile: ProfileName;
|
|
35
|
+
platform: string;
|
|
36
|
+
}
|
|
37
|
+
export interface ProjectCounts {
|
|
38
|
+
plansOpen?: number;
|
|
39
|
+
pendingQuestions?: number;
|
|
40
|
+
monitorsActive?: number;
|
|
41
|
+
cronEnabledCount?: number;
|
|
42
|
+
}
|
|
43
|
+
export declare function parseGitRemote(raw: string): GitRemoteInfo;
|
|
44
|
+
export declare function getGitRemote(workingDir: string): GitRemoteInfo | null;
|
|
45
|
+
export declare function getGitBranch(workingDir: string): string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Stable project id — same across machines if the workspace shares a git
|
|
48
|
+
* remote; falls back to a (workingDir + hostname)-keyed id otherwise.
|
|
49
|
+
*/
|
|
50
|
+
export declare function deriveProjectId(workingDir: string, remote: GitRemoteInfo | null): string;
|
|
51
|
+
export declare function shouldRegister(profile: ProfileName, env?: NodeJS.ProcessEnv): boolean;
|
|
52
|
+
export declare function buildProjectIdentity(workingDir: string, profile: ProfileName, env?: NodeJS.ProcessEnv): ProjectIdentity | null;
|
|
53
|
+
export interface RegisterResult {
|
|
54
|
+
ok: boolean;
|
|
55
|
+
projectId?: string;
|
|
56
|
+
reason?: 'opted-out' | 'no-auth' | 'lambda-error' | 'thrown';
|
|
57
|
+
error?: string;
|
|
58
|
+
}
|
|
59
|
+
export declare function registerProject(workingDir: string, profile: ProfileName, counts?: ProjectCounts, env?: NodeJS.ProcessEnv): Promise<RegisterResult>;
|
|
60
|
+
export declare function heartbeatProject(workingDir: string, profile: ProfileName, counts?: ProjectCounts, env?: NodeJS.ProcessEnv): Promise<RegisterResult>;
|
|
61
|
+
//# sourceMappingURL=projectRegistration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"projectRegistration.d.ts","sourceRoot":"","sources":["../../src/utils/projectRegistration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAG9D,MAAM,WAAW,aAAa;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK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EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,WAAW,GAAG,SAAS,GAAG,cAAc,GAAG,QAAQ,CAAC;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAqDD,wBAAsB,eAAe,CACnC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,aAAkB,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,cAAc,CAAC,CAIzB;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,EACpB,MAAM,GAAE,aAAkB,EAC1B,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,OAAO,CAAC,cAAc,CAAC,CAIzB"}
|
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Projects rendezvous — CLI side.
|
|
3
|
+
*
|
|
4
|
+
* Each workspace the CLI operates in registers a project record at
|
|
5
|
+
* users/<uid>/projects/<projectId> via the cliProjectRegister Lambda
|
|
6
|
+
* callable. The portal renders these as a cross-machine "where am I
|
|
7
|
+
* working" dashboard.
|
|
8
|
+
*
|
|
9
|
+
* Privacy posture:
|
|
10
|
+
* - default coding profile registers full remote URL.
|
|
11
|
+
* - offsec profiles do NOT register by default. Operator can opt in
|
|
12
|
+
* via EROSOLAR_ENABLE_PROJECT_REGISTRATION=1; even then host + owner
|
|
13
|
+
* are masked so target identity does not leak.
|
|
14
|
+
* - any profile can opt out with EROSOLAR_DISABLE_PROJECT_REGISTRATION=1.
|
|
15
|
+
*
|
|
16
|
+
* Best-effort: a failed call never blocks the agent loop.
|
|
17
|
+
*/
|
|
18
|
+
import { execFileSync } from 'node:child_process';
|
|
19
|
+
import { createHash } from 'node:crypto';
|
|
20
|
+
import { hostname, platform } from 'node:os';
|
|
21
|
+
import { basename } from 'node:path';
|
|
22
|
+
import { isOffsecProfile } from '../runtime/profileGates.js';
|
|
23
|
+
import { callLambda } from './lambdaClient.js';
|
|
24
|
+
const SCP_LIKE_RE = /^(?:[^@]+@)?([^:]+):(.+?)(?:\.git)?$/;
|
|
25
|
+
const URL_LIKE_RE = /^(?:https?|git|ssh):\/\/(?:[^@]+@)?([^/]+)\/(.+?)(?:\.git)?$/;
|
|
26
|
+
function buildGithubUrl(host, owner, repo) {
|
|
27
|
+
if (host.toLowerCase() !== 'github.com')
|
|
28
|
+
return null;
|
|
29
|
+
if (!owner || !repo)
|
|
30
|
+
return null;
|
|
31
|
+
return 'https://github.com/' + owner + '/' + repo;
|
|
32
|
+
}
|
|
33
|
+
export function parseGitRemote(raw) {
|
|
34
|
+
const trimmed = raw.trim();
|
|
35
|
+
const fallback = { raw: trimmed, host: null, owner: null, repo: null, githubUrl: null };
|
|
36
|
+
if (!trimmed)
|
|
37
|
+
return fallback;
|
|
38
|
+
let host = null;
|
|
39
|
+
let pathPart = null;
|
|
40
|
+
const urlMatch = trimmed.match(URL_LIKE_RE);
|
|
41
|
+
if (urlMatch) {
|
|
42
|
+
host = urlMatch[1] ?? null;
|
|
43
|
+
pathPart = urlMatch[2] ?? null;
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
const scpMatch = trimmed.match(SCP_LIKE_RE);
|
|
47
|
+
if (scpMatch) {
|
|
48
|
+
host = scpMatch[1] ?? null;
|
|
49
|
+
pathPart = scpMatch[2] ?? null;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (!host || !pathPart)
|
|
53
|
+
return fallback;
|
|
54
|
+
const cleanedPath = pathPart.replace(/\.git$/, '');
|
|
55
|
+
const segments = cleanedPath.split('/').filter(Boolean);
|
|
56
|
+
if (segments.length < 2) {
|
|
57
|
+
return { raw: trimmed, host, owner: null, repo: segments[0] ?? null, githubUrl: null };
|
|
58
|
+
}
|
|
59
|
+
const repo = segments[segments.length - 1] ?? null;
|
|
60
|
+
const owner = segments[segments.length - 2] ?? null;
|
|
61
|
+
const githubUrl = buildGithubUrl(host, owner, repo);
|
|
62
|
+
return { raw: trimmed, host, owner, repo, githubUrl };
|
|
63
|
+
}
|
|
64
|
+
function gitOutput(cwd, args) {
|
|
65
|
+
try {
|
|
66
|
+
const out = execFileSync('git', args, {
|
|
67
|
+
cwd,
|
|
68
|
+
encoding: 'utf-8',
|
|
69
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
70
|
+
});
|
|
71
|
+
return out.trim();
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
export function getGitRemote(workingDir) {
|
|
78
|
+
const url = gitOutput(workingDir, ['remote', 'get-url', 'origin']);
|
|
79
|
+
if (!url)
|
|
80
|
+
return null;
|
|
81
|
+
return parseGitRemote(url);
|
|
82
|
+
}
|
|
83
|
+
export function getGitBranch(workingDir) {
|
|
84
|
+
return gitOutput(workingDir, ['rev-parse', '--abbrev-ref', 'HEAD']);
|
|
85
|
+
}
|
|
86
|
+
function sha256Hex(input, length) {
|
|
87
|
+
return createHash('sha256').update(input).digest('hex').slice(0, length);
|
|
88
|
+
}
|
|
89
|
+
function projectIdFromRemote(remote) {
|
|
90
|
+
if (remote.host && remote.owner && remote.repo) {
|
|
91
|
+
const key = remote.host.toLowerCase() + '/' + remote.owner.toLowerCase() + '/' + remote.repo.toLowerCase();
|
|
92
|
+
return 'git-' + sha256Hex(key, 24);
|
|
93
|
+
}
|
|
94
|
+
return 'git-' + sha256Hex(remote.raw.toLowerCase(), 24);
|
|
95
|
+
}
|
|
96
|
+
function projectIdFromLocal(workingDir) {
|
|
97
|
+
return 'local-' + sha256Hex(hostname() + '::' + workingDir, 24);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Stable project id — same across machines if the workspace shares a git
|
|
101
|
+
* remote; falls back to a (workingDir + hostname)-keyed id otherwise.
|
|
102
|
+
*/
|
|
103
|
+
export function deriveProjectId(workingDir, remote) {
|
|
104
|
+
if (remote)
|
|
105
|
+
return projectIdFromRemote(remote);
|
|
106
|
+
return projectIdFromLocal(workingDir);
|
|
107
|
+
}
|
|
108
|
+
function maskRemote(remote) {
|
|
109
|
+
const repo = remote.repo;
|
|
110
|
+
return {
|
|
111
|
+
raw: repo ? '*****/' + repo : '*****',
|
|
112
|
+
host: remote.host ? '*****' : null,
|
|
113
|
+
owner: remote.owner ? '*****' : null,
|
|
114
|
+
repo,
|
|
115
|
+
githubUrl: null,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export function shouldRegister(profile, env = process.env) {
|
|
119
|
+
if (env['EROSOLAR_DISABLE_PROJECT_REGISTRATION'] === '1')
|
|
120
|
+
return false;
|
|
121
|
+
if (isOffsecProfile(profile)) {
|
|
122
|
+
return env['EROSOLAR_ENABLE_PROJECT_REGISTRATION'] === '1';
|
|
123
|
+
}
|
|
124
|
+
return true;
|
|
125
|
+
}
|
|
126
|
+
export function buildProjectIdentity(workingDir, profile, env = process.env) {
|
|
127
|
+
if (!shouldRegister(profile, env))
|
|
128
|
+
return null;
|
|
129
|
+
const rawRemote = getGitRemote(workingDir);
|
|
130
|
+
const masked = isOffsecProfile(profile);
|
|
131
|
+
const remote = rawRemote && masked ? maskRemote(rawRemote) : rawRemote;
|
|
132
|
+
const projectId = deriveProjectId(workingDir, rawRemote);
|
|
133
|
+
const branch = getGitBranch(workingDir);
|
|
134
|
+
let name;
|
|
135
|
+
if (remote && remote.repo) {
|
|
136
|
+
name = remote.repo;
|
|
137
|
+
}
|
|
138
|
+
else if (remote && remote.raw) {
|
|
139
|
+
const last = remote.raw.split('/').pop() || '';
|
|
140
|
+
name = last.replace(/\.git$/, '') || basename(workingDir) || 'workspace';
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
name = basename(workingDir) || 'workspace';
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
projectId,
|
|
147
|
+
name,
|
|
148
|
+
branch,
|
|
149
|
+
remote,
|
|
150
|
+
masked,
|
|
151
|
+
workingDirHash: sha256Hex(workingDir, 16),
|
|
152
|
+
hostname: hostname(),
|
|
153
|
+
profile,
|
|
154
|
+
platform: platform(),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
function payloadFromIdentity(identity, counts) {
|
|
158
|
+
return {
|
|
159
|
+
projectId: identity.projectId,
|
|
160
|
+
name: identity.name,
|
|
161
|
+
branch: identity.branch,
|
|
162
|
+
hostname: identity.hostname,
|
|
163
|
+
profile: identity.profile,
|
|
164
|
+
masked: identity.masked,
|
|
165
|
+
workingDirHash: identity.workingDirHash,
|
|
166
|
+
platform: identity.platform,
|
|
167
|
+
gitRemote: identity.remote ? identity.remote.raw : null,
|
|
168
|
+
gitRemoteHost: identity.remote ? identity.remote.host : null,
|
|
169
|
+
gitRemoteOwner: identity.remote ? identity.remote.owner : null,
|
|
170
|
+
gitRemoteRepo: identity.remote ? identity.remote.repo : null,
|
|
171
|
+
githubUrl: identity.remote ? identity.remote.githubUrl : null,
|
|
172
|
+
plansOpen: counts.plansOpen ?? 0,
|
|
173
|
+
pendingQuestions: counts.pendingQuestions ?? 0,
|
|
174
|
+
monitorsActive: counts.monitorsActive ?? 0,
|
|
175
|
+
cronEnabledCount: counts.cronEnabledCount ?? 0,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
async function callProjectLambda(name, identity, counts) {
|
|
179
|
+
try {
|
|
180
|
+
const result = await callLambda(name, payloadFromIdentity(identity, counts));
|
|
181
|
+
if (!result.ok) {
|
|
182
|
+
return {
|
|
183
|
+
ok: false,
|
|
184
|
+
projectId: identity.projectId,
|
|
185
|
+
reason: result.status === 401 ? 'no-auth' : 'lambda-error',
|
|
186
|
+
error: result.error,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
return { ok: true, projectId: result.result?.projectId ?? identity.projectId };
|
|
190
|
+
}
|
|
191
|
+
catch (err) {
|
|
192
|
+
return {
|
|
193
|
+
ok: false,
|
|
194
|
+
projectId: identity.projectId,
|
|
195
|
+
reason: 'thrown',
|
|
196
|
+
error: err instanceof Error ? err.message : String(err),
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
export async function registerProject(workingDir, profile, counts = {}, env = process.env) {
|
|
201
|
+
const identity = buildProjectIdentity(workingDir, profile, env);
|
|
202
|
+
if (!identity)
|
|
203
|
+
return { ok: false, reason: 'opted-out' };
|
|
204
|
+
return callProjectLambda('cliProjectRegister', identity, counts);
|
|
205
|
+
}
|
|
206
|
+
export async function heartbeatProject(workingDir, profile, counts = {}, env = process.env) {
|
|
207
|
+
const identity = buildProjectIdentity(workingDir, profile, env);
|
|
208
|
+
if (!identity)
|
|
209
|
+
return { ok: false, reason: 'opted-out' };
|
|
210
|
+
return callProjectLambda('cliProjectHeartbeat', identity, counts);
|
|
211
|
+
}
|
|
212
|
+
//# sourceMappingURL=projectRegistration.js.map
|