charness 4.3.1 → 4.4.1
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/CHANGELOG.md +24 -0
- package/DEVELOPMENT.md +3 -1
- package/README.md +2 -1
- package/agent-plugin/README.md +6 -5
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +4 -1
- package/agent-plugin/skills/charness-delivery-loop/SKILL.md +9 -9
- package/agent-plugin/skills/charness-orchestration/SKILL.md +8 -4
- package/dist/adapters/adapterEventRouting.d.ts +2 -1
- package/dist/adapters/adapterEventRouting.d.ts.map +1 -1
- package/dist/adapters/adapterEventRouting.js +3 -0
- package/dist/adapters/adapterEventRouting.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +11 -6
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.d.ts +11 -3
- package/dist/adapters/claudeJsonStreamAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +48 -16
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/createAdapter.d.ts +1 -0
- package/dist/adapters/createAdapter.d.ts.map +1 -1
- package/dist/adapters/createAdapter.js +4 -0
- package/dist/adapters/createAdapter.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +68 -11
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +194 -70
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/adapters/terminalAdapter.js +1 -1
- package/dist/adapters/terminalAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/agentLogin/agentLogin.js +6 -5
- package/dist/agentLogin/agentLogin.js.map +1 -1
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +109 -97
- package/dist/bot.js.map +1 -1
- package/dist/botFileStorage.d.ts.map +1 -1
- package/dist/botFileStorage.js +6 -5
- package/dist/botFileStorage.js.map +1 -1
- package/dist/cli/bot.d.ts +2 -1
- package/dist/cli/bot.d.ts.map +1 -1
- package/dist/cli/bot.js +14 -10
- package/dist/cli/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +4 -1
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +42 -3
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli/hot.d.ts +3 -0
- package/dist/cli/hot.d.ts.map +1 -1
- package/dist/cli/hot.js +32 -3
- package/dist/cli/hot.js.map +1 -1
- package/dist/configDirFile.d.ts +23 -5
- package/dist/configDirFile.d.ts.map +1 -1
- package/dist/configDirFile.js +59 -19
- package/dist/configDirFile.js.map +1 -1
- package/dist/configDirectory.d.ts +9 -0
- package/dist/configDirectory.d.ts.map +1 -0
- package/dist/configDirectory.js +57 -0
- package/dist/configDirectory.js.map +1 -0
- package/dist/connectors/jira/agentBinaries.d.ts.map +1 -1
- package/dist/connectors/jira/agentBinaries.js +7 -6
- package/dist/connectors/jira/agentBinaries.js.map +1 -1
- package/dist/connectors/jira/attachmentDownload.d.ts.map +1 -1
- package/dist/connectors/jira/attachmentDownload.js +3 -3
- package/dist/connectors/jira/attachmentDownload.js.map +1 -1
- package/dist/connectors/jira/attachmentTool.d.ts.map +1 -1
- package/dist/connectors/jira/attachmentTool.js +4 -3
- package/dist/connectors/jira/attachmentTool.js.map +1 -1
- package/dist/connectors/jira/contextLedger.d.ts.map +1 -1
- package/dist/connectors/jira/contextLedger.js +5 -4
- package/dist/connectors/jira/contextLedger.js.map +1 -1
- package/dist/connectors/jira/promptSpill.d.ts.map +1 -1
- package/dist/connectors/jira/promptSpill.js +5 -5
- package/dist/connectors/jira/promptSpill.js.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts +12 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +253 -89
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/fallbackChain.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/fallbackChain.js +8 -7
- package/dist/connectors/telegram/commands/fallbackChain.js.map +1 -1
- package/dist/connectors/telegram/commands/limitsBoard.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/limitsBoard.js +3 -1
- package/dist/connectors/telegram/commands/limitsBoard.js.map +1 -1
- package/dist/connectors/telegram/commands/modelPage.d.ts +2 -0
- package/dist/connectors/telegram/commands/modelPage.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/modelPage.js +1 -1
- package/dist/connectors/telegram/commands/modelPage.js.map +1 -1
- package/dist/dataDirFs.d.ts +95 -0
- package/dist/dataDirFs.d.ts.map +1 -0
- package/dist/dataDirFs.js +348 -0
- package/dist/dataDirFs.js.map +1 -0
- package/dist/diagLog.d.ts.map +1 -1
- package/dist/diagLog.js +7 -3
- package/dist/diagLog.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +42 -25
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +42 -25
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +42 -25
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +42 -25
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +42 -25
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +42 -25
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +42 -25
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +42 -25
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +42 -25
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +42 -25
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +42 -25
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +42 -25
- package/dist/i18n/zh.js.map +1 -1
- package/dist/i18n.d.ts +0 -12
- package/dist/i18n.d.ts.map +1 -1
- package/dist/i18n.js +6 -4
- package/dist/i18n.js.map +1 -1
- package/dist/installManager.d.ts +2 -2
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +53 -64
- package/dist/installManager.js.map +1 -1
- package/dist/instanceLock.d.ts +95 -0
- package/dist/instanceLock.d.ts.map +1 -1
- package/dist/instanceLock.js +293 -28
- package/dist/instanceLock.js.map +1 -1
- package/dist/instanceSettings.d.ts +4 -1
- package/dist/instanceSettings.d.ts.map +1 -1
- package/dist/instanceSettings.js +5 -1
- package/dist/instanceSettings.js.map +1 -1
- package/dist/legacyNames.d.ts +11 -0
- package/dist/legacyNames.d.ts.map +1 -1
- package/dist/legacyNames.js +12 -1
- package/dist/legacyNames.js.map +1 -1
- package/dist/mcpConfig.d.ts.map +1 -1
- package/dist/mcpConfig.js +10 -9
- package/dist/mcpConfig.js.map +1 -1
- package/dist/outputTrace.d.ts.map +1 -1
- package/dist/outputTrace.js +12 -6
- package/dist/outputTrace.js.map +1 -1
- package/dist/processIdentity.d.ts +18 -0
- package/dist/processIdentity.d.ts.map +1 -0
- package/dist/processIdentity.js +136 -0
- package/dist/processIdentity.js.map +1 -0
- package/dist/remoteRun/commands.d.ts.map +1 -1
- package/dist/remoteRun/commands.js +4 -4
- package/dist/remoteRun/commands.js.map +1 -1
- package/dist/remoteRun/heldBackNotice.d.ts.map +1 -1
- package/dist/remoteRun/heldBackNotice.js +4 -3
- package/dist/remoteRun/heldBackNotice.js.map +1 -1
- package/dist/remoteRun/jobFiles.d.ts.map +1 -1
- package/dist/remoteRun/jobFiles.js +3 -2
- package/dist/remoteRun/jobFiles.js.map +1 -1
- package/dist/remoteRun/jobRecords.d.ts.map +1 -1
- package/dist/remoteRun/jobRecords.js +4 -3
- package/dist/remoteRun/jobRecords.js.map +1 -1
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +5 -4
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/safeCopy.d.ts.map +1 -1
- package/dist/remoteRun/safeCopy.js +5 -4
- package/dist/remoteRun/safeCopy.js.map +1 -1
- package/dist/remoteRun/ssh.d.ts.map +1 -1
- package/dist/remoteRun/ssh.js +4 -4
- package/dist/remoteRun/ssh.js.map +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +2 -1
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/requests/wakeUpEngine.d.ts +8 -0
- package/dist/requests/wakeUpEngine.d.ts.map +1 -1
- package/dist/requests/wakeUpEngine.js +19 -2
- package/dist/requests/wakeUpEngine.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +11 -10
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/appUpdate.d.ts.map +1 -1
- package/dist/runnerUtility/appUpdate.js +3 -3
- package/dist/runnerUtility/appUpdate.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +0 -5
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +2 -24
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgent.d.ts.map +1 -1
- package/dist/runnerUtility/guiAgent.js +12 -11
- package/dist/runnerUtility/guiAgent.js.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.js +4 -3
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +2 -1
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -1
- package/dist/runnerUtility/keepAwake.js +2 -1
- package/dist/runnerUtility/keepAwake.js.map +1 -1
- package/dist/runnerUtility/launcher.d.ts.map +1 -1
- package/dist/runnerUtility/launcher.js +2 -1
- package/dist/runnerUtility/launcher.js.map +1 -1
- package/dist/runnerUtility/nodeUpkeep.d.ts.map +1 -1
- package/dist/runnerUtility/nodeUpkeep.js +4 -3
- package/dist/runnerUtility/nodeUpkeep.js.map +1 -1
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -1
- package/dist/runnerUtility/packageManagerShims.js +5 -4
- package/dist/runnerUtility/packageManagerShims.js.map +1 -1
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +3 -2
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/runnerCli.js +2 -1
- package/dist/runnerUtility/runnerCli.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +6 -5
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerConfig.d.ts.map +1 -1
- package/dist/runnerUtility/runnerConfig.js +2 -1
- package/dist/runnerUtility/runnerConfig.js.map +1 -1
- package/dist/runnerUtility/runnerFlags.d.ts.map +1 -1
- package/dist/runnerUtility/runnerFlags.js +3 -2
- package/dist/runnerUtility/runnerFlags.js.map +1 -1
- package/dist/runnerUtility/runnerKeys.d.ts.map +1 -1
- package/dist/runnerUtility/runnerKeys.js +2 -1
- package/dist/runnerUtility/runnerKeys.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +15 -14
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/simctlGuard.d.ts.map +1 -1
- package/dist/runnerUtility/simctlGuard.js +3 -2
- package/dist/runnerUtility/simctlGuard.js.map +1 -1
- package/dist/runnerUtility/toolInstall.d.ts.map +1 -1
- package/dist/runnerUtility/toolInstall.js +11 -10
- package/dist/runnerUtility/toolInstall.js.map +1 -1
- package/dist/runners/authorizedKeys.d.ts.map +1 -1
- package/dist/runners/authorizedKeys.js +2 -1
- package/dist/runners/authorizedKeys.js.map +1 -1
- package/dist/runners/gateLink.d.ts.map +1 -1
- package/dist/runners/gateLink.js +4 -3
- package/dist/runners/gateLink.js.map +1 -1
- package/dist/runners/hubLock.d.ts.map +1 -1
- package/dist/runners/hubLock.js +9 -8
- package/dist/runners/hubLock.js.map +1 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +5 -4
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/linkControl.d.ts.map +1 -1
- package/dist/runners/linkControl.js +7 -6
- package/dist/runners/linkControl.js.map +1 -1
- package/dist/scheduler/injection.d.ts +5 -3
- package/dist/scheduler/injection.d.ts.map +1 -1
- package/dist/scheduler/injection.js +15 -4
- package/dist/scheduler/injection.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +19 -13
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/selfUpdate/gitSource.d.ts.map +1 -1
- package/dist/selfUpdate/gitSource.js +2 -2
- package/dist/selfUpdate/gitSource.js.map +1 -1
- package/dist/selfUpdate/hostLock.d.ts.map +1 -1
- package/dist/selfUpdate/hostLock.js +4 -3
- package/dist/selfUpdate/hostLock.js.map +1 -1
- package/dist/selfUpdate/restart.d.ts +8 -0
- package/dist/selfUpdate/restart.d.ts.map +1 -1
- package/dist/selfUpdate/restart.js +10 -0
- package/dist/selfUpdate/restart.js.map +1 -1
- package/dist/selfUpdate/selfCheck.d.ts.map +1 -1
- package/dist/selfUpdate/selfCheck.js +3 -2
- package/dist/selfUpdate/selfCheck.js.map +1 -1
- package/dist/selfUpdate/updatePending.d.ts.map +1 -1
- package/dist/selfUpdate/updatePending.js +2 -1
- package/dist/selfUpdate/updatePending.js.map +1 -1
- package/dist/state.d.ts +21 -4
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +53 -20
- package/dist/state.js.map +1 -1
- package/dist/stt/sttAutoInstall.d.ts.map +1 -1
- package/dist/stt/sttAutoInstall.js +9 -2
- package/dist/stt/sttAutoInstall.js.map +1 -1
- package/dist/stt/sttInstall.d.ts.map +1 -1
- package/dist/stt/sttInstall.js +18 -17
- package/dist/stt/sttInstall.js.map +1 -1
- package/dist/stt/sttInstallEntry.js +12 -2
- package/dist/stt/sttInstallEntry.js.map +1 -1
- package/dist/stt/sttSettings.d.ts.map +1 -1
- package/dist/stt/sttSettings.js +6 -2
- package/dist/stt/sttSettings.js.map +1 -1
- package/dist/stt/sttSidecarOwner.d.ts +0 -3
- package/dist/stt/sttSidecarOwner.d.ts.map +1 -1
- package/dist/stt/sttSidecarOwner.js +11 -12
- package/dist/stt/sttSidecarOwner.js.map +1 -1
- package/dist/todos/projects.d.ts.map +1 -1
- package/dist/todos/projects.js +2 -1
- package/dist/todos/projects.js.map +1 -1
- package/dist/todos/store.d.ts.map +1 -1
- package/dist/todos/store.js +5 -4
- package/dist/todos/store.js.map +1 -1
- package/dist/types.d.ts +8 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/agentEnvironment.d.ts +19 -8
- package/dist/utils/agentEnvironment.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.js +32 -12
- package/dist/utils/agentEnvironment.js.map +1 -1
- package/dist/utils/agentPlugin.d.ts +2 -0
- package/dist/utils/agentPlugin.d.ts.map +1 -1
- package/dist/utils/agentPlugin.js +8 -6
- package/dist/utils/agentPlugin.js.map +1 -1
- package/dist/utils/backendSwitchPlan.d.ts +4 -1
- package/dist/utils/backendSwitchPlan.d.ts.map +1 -1
- package/dist/utils/backendSwitchPlan.js +6 -2
- package/dist/utils/backendSwitchPlan.js.map +1 -1
- package/dist/utils/claudeAccountAlert.d.ts +6 -3
- package/dist/utils/claudeAccountAlert.d.ts.map +1 -1
- package/dist/utils/claudeAccountAlert.js +13 -7
- package/dist/utils/claudeAccountAlert.js.map +1 -1
- package/dist/utils/claudeAccountPickerPlan.d.ts +17 -3
- package/dist/utils/claudeAccountPickerPlan.d.ts.map +1 -1
- package/dist/utils/claudeAccountPickerPlan.js +19 -4
- package/dist/utils/claudeAccountPickerPlan.js.map +1 -1
- package/dist/utils/claudeApiCredit.d.ts.map +1 -1
- package/dist/utils/claudeApiCredit.js +4 -1
- package/dist/utils/claudeApiCredit.js.map +1 -1
- package/dist/utils/claudeCompactHook.js +5 -5
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeProfileLabels.d.ts +160 -0
- package/dist/utils/claudeProfileLabels.d.ts.map +1 -0
- package/dist/utils/claudeProfileLabels.js +283 -0
- package/dist/utils/claudeProfileLabels.js.map +1 -0
- package/dist/utils/claudeProfileUsageViews.d.ts +2 -0
- package/dist/utils/claudeProfileUsageViews.d.ts.map +1 -1
- package/dist/utils/claudeProfileUsageViews.js +3 -1
- package/dist/utils/claudeProfileUsageViews.js.map +1 -1
- package/dist/utils/claudeProfiles.d.ts +9 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +19 -17
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeStreamJson.d.ts +1 -0
- package/dist/utils/claudeStreamJson.d.ts.map +1 -1
- package/dist/utils/claudeStreamJson.js +2 -1
- package/dist/utils/claudeStreamJson.js.map +1 -1
- package/dist/utils/claudeTranscriptContent.d.ts.map +1 -1
- package/dist/utils/claudeTranscriptContent.js +2 -1
- package/dist/utils/claudeTranscriptContent.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +5 -0
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +1 -0
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/compactSelfReviewFlags.d.ts.map +1 -1
- package/dist/utils/compactSelfReviewFlags.js +5 -4
- package/dist/utils/compactSelfReviewFlags.js.map +1 -1
- package/dist/utils/consoleFileTap.d.ts +11 -5
- package/dist/utils/consoleFileTap.d.ts.map +1 -1
- package/dist/utils/consoleFileTap.js +55 -18
- package/dist/utils/consoleFileTap.js.map +1 -1
- package/dist/utils/download.d.ts.map +1 -1
- package/dist/utils/download.js +3 -4
- package/dist/utils/download.js.map +1 -1
- package/dist/utils/fallbackChain.d.ts +4 -2
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +4 -3
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/fallbackSwitchNotice.d.ts +1 -1
- package/dist/utils/fallbackSwitchNotice.d.ts.map +1 -1
- package/dist/utils/fallbackSwitchNotice.js +4 -3
- package/dist/utils/fallbackSwitchNotice.js.map +1 -1
- package/dist/utils/fileSendService.js +6 -4
- package/dist/utils/fileSendService.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +1 -1
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +6 -5
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/jsonStreamUnconsumedInput.d.ts +2 -0
- package/dist/utils/jsonStreamUnconsumedInput.d.ts.map +1 -1
- package/dist/utils/jsonStreamUnconsumedInput.js.map +1 -1
- package/dist/utils/limitsBoardPlan.d.ts +6 -4
- package/dist/utils/limitsBoardPlan.d.ts.map +1 -1
- package/dist/utils/limitsBoardPlan.js +11 -5
- package/dist/utils/limitsBoardPlan.js.map +1 -1
- package/dist/utils/midTurnAnswerWatch.d.ts +69 -0
- package/dist/utils/midTurnAnswerWatch.d.ts.map +1 -0
- package/dist/utils/midTurnAnswerWatch.js +87 -0
- package/dist/utils/midTurnAnswerWatch.js.map +1 -0
- package/dist/utils/midTurnInbox.d.ts.map +1 -1
- package/dist/utils/midTurnInbox.js +9 -8
- package/dist/utils/midTurnInbox.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +6 -0
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +46 -7
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/openCodeMessageId.d.ts +16 -0
- package/dist/utils/openCodeMessageId.d.ts.map +1 -0
- package/dist/utils/openCodeMessageId.js +51 -0
- package/dist/utils/openCodeMessageId.js.map +1 -0
- package/dist/utils/parseEnvFile.d.ts +11 -0
- package/dist/utils/parseEnvFile.d.ts.map +1 -0
- package/dist/utils/parseEnvFile.js +31 -0
- package/dist/utils/parseEnvFile.js.map +1 -0
- package/dist/utils/promptDelivery.d.ts +37 -1
- package/dist/utils/promptDelivery.d.ts.map +1 -1
- package/dist/utils/promptDelivery.js +52 -0
- package/dist/utils/promptDelivery.js.map +1 -1
- package/dist/utils/rotatingJsonlFile.d.ts.map +1 -1
- package/dist/utils/rotatingJsonlFile.js +4 -3
- package/dist/utils/rotatingJsonlFile.js.map +1 -1
- package/dist/utils/rotatingLogFile.d.ts.map +1 -1
- package/dist/utils/rotatingLogFile.js +2 -1
- package/dist/utils/rotatingLogFile.js.map +1 -1
- package/dist/utils/threadStatusReport.d.ts +2 -0
- package/dist/utils/threadStatusReport.d.ts.map +1 -1
- package/dist/utils/threadStatusReport.js +4 -3
- package/dist/utils/threadStatusReport.js.map +1 -1
- package/dist/utils/tmuxExec.d.ts +6 -6
- package/dist/utils/tmuxExec.d.ts.map +1 -1
- package/dist/utils/tmuxExec.js +9 -9
- package/dist/utils/tmuxExec.js.map +1 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @description The DISPLAY NAME of a Claude account (`/accounts`), apart from its fixed internal id. The id names the account's folder
|
|
4
|
+
* (`DATA_DIR/claude-profiles/<id>/`), its button data, the `/limits` list's rungs, every topic's pick and the name agents record — so it
|
|
5
|
+
* never changes once the account exists. The display name is free text the operator gives at ➕ and changes with ✏️ «Rename»:
|
|
6
|
+
* capitals, dots, spaces, `@`, Cyrillic, emoji, up to {@link claudeProfileLabelMaxLength} characters. The bot derives the id from it
|
|
7
|
+
* ({@link deriveClaudeProfileId}) and shows the display name wherever it names the account; an account with no display name (one
|
|
8
|
+
* added before display names existed, one adopted from a folder made by hand) shows its id, and `default` (`~/.claude`) shows «Main»
|
|
9
|
+
* in the reader's language until it is renamed — nothing is migrated.
|
|
10
|
+
*
|
|
11
|
+
* Rules that keep a typed name unambiguous ({@link checkClaudeProfileLabel}): no two accounts share a display name (case ignored) and no
|
|
12
|
+
* display name equals another account's id, so `/accounts use|login|remove <name>` finds one account by either
|
|
13
|
+
* ({@link findClaudeProfileByTypedName}); a derived id never equals another account's display name either.
|
|
14
|
+
*
|
|
15
|
+
* The rules are pure. The resolver every screen calls ({@link getClaudeProfileLabel}) reads the stored names through the reader the bot
|
|
16
|
+
* registers at start-up ({@link setClaudeProfileLabelReader}); the views the ranking, `claude_profiles` and `charness claude-profiles`
|
|
17
|
+
* read carry the name themselves (`utils/claudeProfileUsageViews.ts`). Not loaded by the connector guards: it reads the locale.
|
|
18
|
+
*/
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.claudeProfileButtonWordIds = exports.claudeProfileButtonLabelMaxLength = exports.claudeProfileLabelMaxLength = void 0;
|
|
21
|
+
exports.normaliseClaudeProfileLabel = normaliseClaudeProfileLabel;
|
|
22
|
+
exports.checkClaudeProfileLabel = checkClaudeProfileLabel;
|
|
23
|
+
exports.deriveClaudeProfileId = deriveClaudeProfileId;
|
|
24
|
+
exports.findClaudeProfileByTypedName = findClaudeProfileByTypedName;
|
|
25
|
+
exports.shortenClaudeProfileLabel = shortenClaudeProfileLabel;
|
|
26
|
+
exports.describeClaudeProfileIdProblem = describeClaudeProfileIdProblem;
|
|
27
|
+
exports.escapeClaudeProfileLabelForMarkdown = escapeClaudeProfileLabelForMarkdown;
|
|
28
|
+
exports.getMainClaudeProfileLabel = getMainClaudeProfileLabel;
|
|
29
|
+
exports.listMainClaudeProfileLabels = listMainClaudeProfileLabels;
|
|
30
|
+
exports.readStoredClaudeProfileLabel = readStoredClaudeProfileLabel;
|
|
31
|
+
exports.resolveClaudeProfileLabel = resolveClaudeProfileLabel;
|
|
32
|
+
exports.buildClaudeProfileNameEntry = buildClaudeProfileNameEntry;
|
|
33
|
+
exports.buildClaudeProfileNameEntries = buildClaudeProfileNameEntries;
|
|
34
|
+
exports.resolveClaudeProfileCommandName = resolveClaudeProfileCommandName;
|
|
35
|
+
exports.setClaudeProfileLabelReader = setClaudeProfileLabelReader;
|
|
36
|
+
exports.getClaudeProfileLabel = getClaudeProfileLabel;
|
|
37
|
+
exports.getClaudeProfileCommandName = getClaudeProfileCommandName;
|
|
38
|
+
const i18n_1 = require("../i18n");
|
|
39
|
+
const claudeProfiles_1 = require("./claudeProfiles");
|
|
40
|
+
/** The longest display name, in characters (code points). */
|
|
41
|
+
exports.claudeProfileLabelMaxLength = 40;
|
|
42
|
+
/** The longest display name a BUTTON shows; a longer one is cut there with `…` (the message text shows it whole). */
|
|
43
|
+
exports.claudeProfileButtonLabelMaxLength = 24;
|
|
44
|
+
/** What a derived id falls back to when nothing of the display name survives (`Работа` keeps `rabota`; `🚀` keeps nothing). */
|
|
45
|
+
const derivedIdFallback = 'account';
|
|
46
|
+
/** The ellipsis a cut label ends with. */
|
|
47
|
+
const ellipsis = '…';
|
|
48
|
+
/** Control and format characters (zero-width, bidi overrides), except the zero-width joiner emoji sequences are made of. */
|
|
49
|
+
const invisibleCharactersRe = /[\p{Cc}\p{Cf}]/gu;
|
|
50
|
+
const zeroWidthJoiner = '';
|
|
51
|
+
/**
|
|
52
|
+
* Letters written as Latin for the derived id, looked up BEFORE accents are dropped (`й` must not become `и`): Cyrillic (Russian,
|
|
53
|
+
* Ukrainian, Belarusian) — `Работа` → `rabota` — and the Latin letters no decomposition reaches. Anything else outside `a–z0-9` (after
|
|
54
|
+
* accents are dropped) becomes a `-`.
|
|
55
|
+
*/
|
|
56
|
+
const transliteration = {
|
|
57
|
+
а: 'a', б: 'b', в: 'v', г: 'g', д: 'd', е: 'e', ё: 'e', ж: 'zh', з: 'z', и: 'i', й: 'y', к: 'k', л: 'l', м: 'm', н: 'n', о: 'o',
|
|
58
|
+
п: 'p', р: 'r', с: 's', т: 't', у: 'u', ф: 'f', х: 'h', ц: 'ts', ч: 'ch', ш: 'sh', щ: 'sch', ъ: '', ы: 'y', ь: '', э: 'e', ю: 'yu',
|
|
59
|
+
я: 'ya', і: 'i', ї: 'yi', є: 'ye', ґ: 'g', ў: 'u',
|
|
60
|
+
ß: 'ss', æ: 'ae', œ: 'oe', ø: 'o', ł: 'l', đ: 'd', þ: 'th',
|
|
61
|
+
};
|
|
62
|
+
/** The number of characters (code points) of a text. */
|
|
63
|
+
function countCharacters(text) {
|
|
64
|
+
return Array.from(text).length;
|
|
65
|
+
}
|
|
66
|
+
/** The lowercase key two names are compared by: case and Unicode composition ignored. */
|
|
67
|
+
function getComparisonKey(text) {
|
|
68
|
+
return text.normalize('NFC').toLowerCase();
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* @description A typed display name as it is kept: Unicode-composed, invisible characters (controls, zero-width marks, bidi overrides)
|
|
72
|
+
* removed — the joiner of an emoji sequence stays —, every run of whitespace (a line break too) one space, trimmed. So a name is always
|
|
73
|
+
* one line and never pretends to be another by an invisible difference.
|
|
74
|
+
*/
|
|
75
|
+
function normaliseClaudeProfileLabel(raw) {
|
|
76
|
+
return raw
|
|
77
|
+
.normalize('NFC')
|
|
78
|
+
.replace(invisibleCharactersRe, (character) => (character === zeroWidthJoiner ? character : ''))
|
|
79
|
+
.replace(/\s+/gu, ' ')
|
|
80
|
+
.trim();
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* @description Why `label` (already {@link normaliseClaudeProfileLabel}d) cannot be the display name of the account `selfName` (`null`
|
|
84
|
+
* for an account about to be added), `null` when it can. `accounts` is every account, `default` included and `selfName` too (it is
|
|
85
|
+
* skipped). Its own id is allowed — renaming an account back to its id gives it no display name of its own.
|
|
86
|
+
*/
|
|
87
|
+
function checkClaudeProfileLabel(input) {
|
|
88
|
+
const { label } = input;
|
|
89
|
+
if (label === '')
|
|
90
|
+
return { kind: 'empty' };
|
|
91
|
+
if (countCharacters(label) > exports.claudeProfileLabelMaxLength)
|
|
92
|
+
return { kind: 'tooLong', max: exports.claudeProfileLabelMaxLength };
|
|
93
|
+
const key = getComparisonKey(label);
|
|
94
|
+
const others = input.accounts.filter((account) => account.name !== input.selfName);
|
|
95
|
+
// A name shown first: an account with no display name of its own shows its id, and that is a name taken, not a hidden id.
|
|
96
|
+
const namesake = others.find((account) => account.labels.some((known) => getComparisonKey(known) === key));
|
|
97
|
+
if (namesake)
|
|
98
|
+
return { kind: 'taken', label: namesake.labels[0] };
|
|
99
|
+
const idOwner = others.find((account) => getComparisonKey(account.name) === key);
|
|
100
|
+
return idOwner ? { kind: 'isId', label: idOwner.labels[0] ?? idOwner.name } : null;
|
|
101
|
+
}
|
|
102
|
+
/** The slug of a display name: Latin letters (Cyrillic transliterated, accents dropped), digits and single `-` between them. */
|
|
103
|
+
function slugifyClaudeProfileLabel(label) {
|
|
104
|
+
const latin = Array.from(label.normalize('NFC').toLowerCase(), (character) => transliteration[character] ?? character)
|
|
105
|
+
.join('')
|
|
106
|
+
.normalize('NFKD')
|
|
107
|
+
.replace(/\p{M}/gu, '');
|
|
108
|
+
return latin.replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Ids a NEW account never gets: the words the picker's own buttons put where an id goes (`acct_login_menu`, `acct_rm_menu` — the sign-in
|
|
112
|
+
* and remove sub-menus, `utils/claudeAccountPickerPlan.ts`). Their exact handlers answer first, so an account `menu` could not be signed in
|
|
113
|
+
* or removed by its buttons. An account of such an id from before stays valid ({@link checkIsValidClaudeProfileName} lets it through).
|
|
114
|
+
*/
|
|
115
|
+
exports.claudeProfileButtonWordIds = new Set(['menu']);
|
|
116
|
+
/** `base` cut so that `suffix` still fits in an id, with no `-` left dangling at the cut. */
|
|
117
|
+
function fitIdBase(base, suffix) {
|
|
118
|
+
return base.slice(0, claudeProfiles_1.claudeProfileNameMaxLength - suffix.length).replace(/-+$/, '');
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @description The id (folder name) a new account with the display name `label` gets: its slug (`Sergei.Solo@work` →
|
|
122
|
+
* `sergei-solo-work`, `Работа` → `rabota`), `account` when nothing of it survives, cut to {@link claudeProfileNameMaxLength}; on a clash
|
|
123
|
+
* — `isTaken` says so: a known account's id, `default`, another account's display name, a folder already on disk — or on a word the
|
|
124
|
+
* buttons use ({@link claudeProfileButtonWordIds}: «Menu» → `menu-2`) a number is added (`work-2`, `work-3`, …). Always a valid id
|
|
125
|
+
* ({@link checkIsValidClaudeProfileName}).
|
|
126
|
+
*/
|
|
127
|
+
function deriveClaudeProfileId(label, isTaken) {
|
|
128
|
+
const base = fitIdBase(slugifyClaudeProfileLabel(label), '') || derivedIdFallback;
|
|
129
|
+
const isFree = (id) => (0, claudeProfiles_1.checkIsValidClaudeProfileName)(id) && !exports.claudeProfileButtonWordIds.has(id) && !isTaken(id);
|
|
130
|
+
if (isFree(base))
|
|
131
|
+
return base;
|
|
132
|
+
for (let number = 2;; number += 1) {
|
|
133
|
+
const suffix = `-${number}`;
|
|
134
|
+
const candidate = `${fitIdBase(base, suffix) || derivedIdFallback}${suffix}`;
|
|
135
|
+
if (isFree(candidate))
|
|
136
|
+
return candidate;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* @description The account a typed name means (`/accounts use|login|remove <name>`): an id or a display name, case and spacing ignored;
|
|
141
|
+
* an id wins over a display name (the rules keep them from clashing, an older state may not). `null` when none matches.
|
|
142
|
+
*/
|
|
143
|
+
function findClaudeProfileByTypedName(typed, accounts) {
|
|
144
|
+
const key = getComparisonKey(normaliseClaudeProfileLabel(typed));
|
|
145
|
+
if (key === '')
|
|
146
|
+
return null;
|
|
147
|
+
const byId = accounts.find((account) => getComparisonKey(account.name) === key);
|
|
148
|
+
if (byId)
|
|
149
|
+
return byId.name;
|
|
150
|
+
return accounts.find((account) => account.labels.some((label) => getComparisonKey(label) === key))?.name ?? null;
|
|
151
|
+
}
|
|
152
|
+
/** @description A display name as a button shows it: whole up to `max` characters, else cut there and ended with `…` (cut between characters, never inside one). */
|
|
153
|
+
function shortenClaudeProfileLabel(label, max = exports.claudeProfileButtonLabelMaxLength) {
|
|
154
|
+
const characters = Array.from(label);
|
|
155
|
+
if (characters.length <= max)
|
|
156
|
+
return label;
|
|
157
|
+
return `${characters.slice(0, max - 1).join('').trimEnd()}${ellipsis}`;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* @description Why `name` cannot be an account id, `null` when it can: one typed by hand (`/accounts add <name> id:<id>`) is lowercased
|
|
161
|
+
* first, so a capital letter is never the problem — the answer names the first character an id cannot hold.
|
|
162
|
+
*/
|
|
163
|
+
function describeClaudeProfileIdProblem(name) {
|
|
164
|
+
if (name === '')
|
|
165
|
+
return { kind: 'empty' };
|
|
166
|
+
if (name === claudeProfiles_1.defaultClaudeProfileName)
|
|
167
|
+
return { kind: 'reserved' };
|
|
168
|
+
if (exports.claudeProfileButtonWordIds.has(name))
|
|
169
|
+
return { kind: 'buttonWord', id: name };
|
|
170
|
+
const characters = Array.from(name);
|
|
171
|
+
if (!/^[a-z0-9]$/.test(characters[0]))
|
|
172
|
+
return { kind: 'firstCharacter', character: characters[0] };
|
|
173
|
+
const bad = characters.find((character) => !/^[a-z0-9_-]$/.test(character));
|
|
174
|
+
if (bad !== undefined)
|
|
175
|
+
return { kind: 'character', character: bad };
|
|
176
|
+
if (characters.length > claudeProfiles_1.claudeProfileNameMaxLength)
|
|
177
|
+
return { kind: 'tooLong', max: claudeProfiles_1.claudeProfileNameMaxLength };
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
// ── what the screens show ──
|
|
181
|
+
/** The ASCII punctuation a display name may hold that Markdown reads as inline markup (emphasis, code, links, HTML, strikethrough, tables). */
|
|
182
|
+
const markdownInlinePunctuationRe = /[\\`*_[\]<>~|]/g;
|
|
183
|
+
/**
|
|
184
|
+
* @description A display name as a Markdown text (a Jira comment, which the connector renders through Markdown) shows it: every character
|
|
185
|
+
* Markdown could read as inline markup is backslash-escaped, so `my_work*` reads as written, never as emphasis or a link. The Telegram
|
|
186
|
+
* screens send plain text and need none of it.
|
|
187
|
+
*/
|
|
188
|
+
function escapeClaudeProfileLabelForMarkdown(label) {
|
|
189
|
+
return label.replace(markdownInlinePunctuationRe, (character) => `\\${character}`);
|
|
190
|
+
}
|
|
191
|
+
/** «Main» — what `default` (`~/.claude`) is called until the operator renames it, in the reader's language. */
|
|
192
|
+
function getMainClaudeProfileLabel() {
|
|
193
|
+
return (0, i18n_1.t)('account.mainLabel');
|
|
194
|
+
}
|
|
195
|
+
/** {@link listMainClaudeProfileLabels}, read once: the locales are fixed for the process. */
|
|
196
|
+
let mainLabelsOfAllLocales = null;
|
|
197
|
+
/**
|
|
198
|
+
* @description «Main» in every locale (`Main`, `Основной`, `Principal`, …), each once. Topics have languages of their own, so what
|
|
199
|
+
* `default` is called depends on who reads it: every one of them is its name, for a typed command and for the rule that no other account
|
|
200
|
+
* takes it.
|
|
201
|
+
*/
|
|
202
|
+
function listMainClaudeProfileLabels() {
|
|
203
|
+
mainLabelsOfAllLocales ??= [...new Set(i18n_1.localeCodes.map((locale) => (0, i18n_1.runWithLocale)(locale, getMainClaudeProfileLabel)))];
|
|
204
|
+
return mainLabelsOfAllLocales;
|
|
205
|
+
}
|
|
206
|
+
/** A stored display name as it is trusted: a non-empty string (a hand-edited `state.json` may hold anything), else none. */
|
|
207
|
+
function readStoredClaudeProfileLabel(value) {
|
|
208
|
+
if (typeof value !== 'string')
|
|
209
|
+
return undefined;
|
|
210
|
+
const label = normaliseClaudeProfileLabel(value);
|
|
211
|
+
return label === '' ? undefined : label;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The «Main» names (any locale) another account already answers to — by its id (an account added before display names, `main`, or
|
|
215
|
+
* `principal`) or by its display name. While one is, `default` unrenamed is not shown by that word alone, and does not answer to it.
|
|
216
|
+
*/
|
|
217
|
+
function listClaimedMainLabelKeys(records) {
|
|
218
|
+
const mainKeys = new Set(listMainClaudeProfileLabels().map(getComparisonKey));
|
|
219
|
+
const claimed = new Set();
|
|
220
|
+
for (const [name, record] of Object.entries(records)) {
|
|
221
|
+
if (name === claudeProfiles_1.defaultClaudeProfileName)
|
|
222
|
+
continue;
|
|
223
|
+
for (const known of [name, readStoredClaudeProfileLabel(record?.label)]) {
|
|
224
|
+
if (known !== undefined && mainKeys.has(getComparisonKey(known)))
|
|
225
|
+
claimed.add(getComparisonKey(known));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return claimed;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* @description What the account `name` is called, read off the whole registry: its display name, else its id — and for `default`
|
|
232
|
+
* «Main» in the reader's language, or «Main (~/.claude)» while another account answers to a «Main» of any locale (an account `main`
|
|
233
|
+
* added before display names existed), so the two never look alike or share a typed name.
|
|
234
|
+
*/
|
|
235
|
+
function resolveClaudeProfileLabel(name, records) {
|
|
236
|
+
const stored = readStoredClaudeProfileLabel(records[name]?.label);
|
|
237
|
+
if (stored !== undefined)
|
|
238
|
+
return stored;
|
|
239
|
+
if (name !== claudeProfiles_1.defaultClaudeProfileName)
|
|
240
|
+
return name;
|
|
241
|
+
const main = getMainClaudeProfileLabel();
|
|
242
|
+
return listClaimedMainLabelKeys(records).size > 0 ? `${main} (~/.claude)` : main;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @description The name-rule entry of an account ({@link ClaudeProfileNameEntry}): its shown name, and — for `default` with no name of
|
|
246
|
+
* its own — «Main» in every locale besides it ({@link listMainClaudeProfileLabels}) but those another account answers to, so a typed
|
|
247
|
+
* `основной` finds it in any topic and no other account takes any of them.
|
|
248
|
+
*/
|
|
249
|
+
function buildClaudeProfileNameEntry(name, records) {
|
|
250
|
+
const shown = resolveClaudeProfileLabel(name, records);
|
|
251
|
+
if (name !== claudeProfiles_1.defaultClaudeProfileName || readStoredClaudeProfileLabel(records[name]?.label) !== undefined)
|
|
252
|
+
return { name, labels: [shown] };
|
|
253
|
+
const claimed = listClaimedMainLabelKeys(records);
|
|
254
|
+
return { name, labels: [shown, ...listMainClaudeProfileLabels().filter((main) => main !== shown && !claimed.has(getComparisonKey(main)))] };
|
|
255
|
+
}
|
|
256
|
+
/** @description The name-rule entries of every account: `default` (always — signed out or not, its id and names stay taken) first, then the added ones. */
|
|
257
|
+
function buildClaudeProfileNameEntries(records) {
|
|
258
|
+
const names = [claudeProfiles_1.defaultClaudeProfileName, ...Object.keys(records).filter((name) => name !== claudeProfiles_1.defaultClaudeProfileName)];
|
|
259
|
+
return names.map((name) => buildClaudeProfileNameEntry(name, records));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* @description What a message tells the operator to TYPE for the account `name` (`/accounts login <it>`): its shown name when that name
|
|
263
|
+
* finds this very account ({@link findClaudeProfileByTypedName}), else its id — a name another account answers to first (an account
|
|
264
|
+
* adopted from a folder `work` beside one called «Work») would send the command elsewhere.
|
|
265
|
+
*/
|
|
266
|
+
function resolveClaudeProfileCommandName(name, records) {
|
|
267
|
+
const label = resolveClaudeProfileLabel(name, records);
|
|
268
|
+
return findClaudeProfileByTypedName(label, buildClaudeProfileNameEntries(records)) === name ? label : name;
|
|
269
|
+
}
|
|
270
|
+
let labelReader = () => ({});
|
|
271
|
+
/** @description Register where {@link getClaudeProfileLabel} reads the registry from (the bot, once, at start-up). Until then every account shows its id (`default` «Main»). */
|
|
272
|
+
function setClaudeProfileLabelReader(reader) {
|
|
273
|
+
labelReader = reader;
|
|
274
|
+
}
|
|
275
|
+
/** @description What the account `name` is called on a screen, in the active locale ({@link resolveClaudeProfileLabel} over the registered registry). */
|
|
276
|
+
function getClaudeProfileLabel(name) {
|
|
277
|
+
return resolveClaudeProfileLabel(name, labelReader());
|
|
278
|
+
}
|
|
279
|
+
/** @description What a message tells the operator to type for the account `name` ({@link resolveClaudeProfileCommandName} over the registered registry). */
|
|
280
|
+
function getClaudeProfileCommandName(name) {
|
|
281
|
+
return resolveClaudeProfileCommandName(name, labelReader());
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=claudeProfileLabels.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"claudeProfileLabels.js","sourceRoot":"","sources":["../../src/utils/claudeProfileLabels.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AA2EH,kEAMC;AAOD,0DAWC;AA8BD,sDASC;AAMD,oEAMC;AAGD,8DAIC;AAMD,wEAUC;AAYD,kFAEC;AAGD,8DAEC;AAUD,kEAGC;AAGD,oEAIC;AA6BD,8DAMC;AAOD,kEAKC;AAGD,sEAGC;AAOD,0EAGC;AAQD,kEAEC;AAGD,sDAEC;AAGD,kEAEC;AArSD,kCAAwD;AACxD,qDAAuH;AAEvH,6DAA6D;AAChD,QAAA,2BAA2B,GAAG,EAAE,CAAC;AAE9C,qHAAqH;AACxG,QAAA,iCAAiC,GAAG,EAAE,CAAC;AAEpD,+HAA+H;AAC/H,MAAM,iBAAiB,GAAG,SAAS,CAAC;AAEpC,0CAA0C;AAC1C,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,4HAA4H;AAC5H,MAAM,qBAAqB,GAAG,kBAAkB,CAAC;A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,CAAC,CAAC;AACxD,CAAC;AAED,4JAA4J;AAC5J,SAAgB,2BAA2B,CAAC,IAAY;IACtD,OAAO,+BAA+B,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -19,6 +19,8 @@ export declare function buildClaudeProfileUsageView(input: {
|
|
|
19
19
|
record: ClaudeProfileRecord | undefined;
|
|
20
20
|
/** The operator's credit figure for it (`readClaudeApiCreditAnchors`); `undefined` = none given. */
|
|
21
21
|
creditAnchor?: ClaudeApiCreditAnchor;
|
|
22
|
+
/** Every record, for the name (`default`'s «Main» reads the others, `utils/claudeProfileLabels.ts`); absent = this record alone. */
|
|
23
|
+
records?: Readonly<Record<string, ClaudeProfileRecord>>;
|
|
22
24
|
}): ClaudeProfileUsageView;
|
|
23
25
|
/**
|
|
24
26
|
* @description The ranking's view of every profile off the registry: `default` (its hidden record, when the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeProfileUsageViews.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAA+D,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"claudeProfileUsageViews.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAA+D,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAG1H,OAAO,EAAiE,KAAK,qBAAqB,EAAE,KAAK,sBAAsB,EAAgC,MAAM,mBAAmB,CAAC;AACzL,OAAO,EAA6B,KAAK,sBAAsB,EAAiC,KAAK,2BAA2B,EAAE,KAAK,oBAAoB,EAAE,KAAK,sBA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ACnF,QAAQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,MAAM,EAAE,IAAI,CAAC,mBAAmB,EAAE,UAAU,GAAG,aAAa,CAAC,GAAG,SAAS,CAAC;CAC3E,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAIrC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,6BAA6B,GAAG;IAC/E,iFAAiF;IACjF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAK3C;AAwCD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,oBAAoB,EAAE,KAAK,EAAE,SAAS,sBAAsB,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,oBAAoB,CAQtJ;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAC7C,KAAK,EAAE,SAAS,sBAAsB,EAAE,EACxC,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,2BAAgC,GACxC,oBAAoB,CAGtB"}
|
|
@@ -18,6 +18,7 @@ exports.addClaudeApiCreditToReport = addClaudeApiCreditToReport;
|
|
|
18
18
|
exports.buildClaudeProfilesCreditReport = buildClaudeProfilesCreditReport;
|
|
19
19
|
const claudeAuthRefusal_1 = require("./claudeAuthRefusal");
|
|
20
20
|
const claudeProfiles_1 = require("./claudeProfiles");
|
|
21
|
+
const claudeProfileLabels_1 = require("./claudeProfileLabels");
|
|
21
22
|
const claudeApiCredit_1 = require("./claudeApiCredit");
|
|
22
23
|
const claudeUsage_1 = require("./claudeUsage");
|
|
23
24
|
/** @description One profile's view: its record's usage, marks and spend, plus the operator's credit figure (what `/accounts` and `/limits` render). */
|
|
@@ -25,6 +26,7 @@ function buildClaudeProfileUsageView(input) {
|
|
|
25
26
|
const { name, record, creditAnchor } = input;
|
|
26
27
|
return {
|
|
27
28
|
name,
|
|
29
|
+
label: (0, claudeProfileLabels_1.resolveClaudeProfileLabel)(name, input.records ?? (record ? { [name]: record } : {})),
|
|
28
30
|
configDir: (0, claudeProfiles_1.resolveClaudeProfileDir)(input.dataDir, name),
|
|
29
31
|
// A refusal by the CLI counts as signed out until the account is signed in again (`utils/claudeAuthRefusal.ts`).
|
|
30
32
|
loggedIn: (0, claudeAuthRefusal_1.getClaudeProfileSignedIn)(record),
|
|
@@ -53,7 +55,7 @@ function buildClaudeProfileUsageView(input) {
|
|
|
53
55
|
function buildClaudeProfileUsageViews(input) {
|
|
54
56
|
// A `default` the operator signed out through /accounts stays out of every ranking until it is signed in again.
|
|
55
57
|
const isDefaultRemoved = input.records.default?.isRemoved === true;
|
|
56
|
-
const toView = (name, record) => buildClaudeProfileUsageView({ dataDir: input.dataDir, name, record, creditAnchor: input.creditAnchors?.[name] });
|
|
58
|
+
const toView = (name, record) => buildClaudeProfileUsageView({ dataDir: input.dataDir, name, record, creditAnchor: input.creditAnchors?.[name], records: input.records });
|
|
57
59
|
const added = Object.entries(input.records)
|
|
58
60
|
.filter(([name]) => name !== 'default')
|
|
59
61
|
.sort(([, a], [, b]) => a.createdAt.localeCompare(b.createdAt));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeProfileUsageViews.js","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;
|
|
1
|
+
{"version":3,"file":"claudeProfileUsageViews.js","sourceRoot":"","sources":["../../src/utils/claudeProfileUsageViews.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAUH,kEAiCC;AAOD,oEAeC;AASD,4DAUC;AAiBD,sEAQC;AAQD,8DAUC;AA4CD,gEAQC;AAQD,0E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AAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAA4B,EAAE;YAChE,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,KAAK,KAAK,CAAC,IAAI,CAAC,CAAC;YACtE,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,4BAA4B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;QACjG,CAAC,CAAC;KACH,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,+BAA+B,CAC7C,KAAwC,EACxC,KAAoB,EACpB,KAAa,EACb,UAAuC,EAAE;IAEzC,MAAM,eAAe,GAAG,0BAA0B,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACjE,OAAO,0BAA0B,CAAC,IAAA,uCAAyB,EAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,GAAG,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;AACnI,CAAC"}
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
* `limitedUntil` mark and a cached usage snapshot, and the resolver takes the known names so a selection that
|
|
27
27
|
* names a removed profile falls back instead of launching a dead directory.
|
|
28
28
|
*/
|
|
29
|
+
import { dataDirFs } from '../dataDirFs';
|
|
29
30
|
/** The profile that is `~/.claude` itself (no `CLAUDE_CONFIG_DIR`). */
|
|
30
31
|
export declare const defaultClaudeProfileName = "default";
|
|
31
32
|
/** Subdirectory of `DATA_DIR` that holds every profile's config directory. */
|
|
@@ -102,6 +103,11 @@ export interface ClaudeProfileRepairResult {
|
|
|
102
103
|
/** The entries still wrong afterwards (`notOwned`, `failed`). */
|
|
103
104
|
pending: string[];
|
|
104
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* The writes a profile folder's repair makes: the data-dir guard (`dataDirFs`) by default. `charness claude-profiles`, which agents run
|
|
108
|
+
* with the bot's DATA_DIR on purpose to repair the account folders they launch workers on, passes `node:fs`.
|
|
109
|
+
*/
|
|
110
|
+
export type ClaudeProfileRepairWriteOps = Pick<typeof dataDirFs, 'renameSync' | 'mkdirSync' | 'symlinkSync'>;
|
|
105
111
|
/** For tests only: forget which profiles were warned about. */
|
|
106
112
|
export declare function resetClaudeProfileRepairWarningsForTests(): void;
|
|
107
113
|
/**
|
|
@@ -131,6 +137,7 @@ export declare function repairClaudeProfileLayout(input: {
|
|
|
131
137
|
uid?: number | null;
|
|
132
138
|
now?: () => number;
|
|
133
139
|
log?: (line: string) => void;
|
|
140
|
+
writeOps?: ClaudeProfileRepairWriteOps;
|
|
134
141
|
}): ClaudeProfileRepairResult;
|
|
135
142
|
/**
|
|
136
143
|
* @description What a profile's `.claude.json` — the account's own state, which the repair never edits — holds that Claude Code treats
|
|
@@ -155,6 +162,8 @@ export declare function repairClaudeProfileFolderForLaunch(input: {
|
|
|
155
162
|
uid?: number | null;
|
|
156
163
|
now?: () => number;
|
|
157
164
|
log?: (line: string) => void;
|
|
165
|
+
/** The repair's writes ({@link ClaudeProfileRepairWriteOps}). */
|
|
166
|
+
writeOps?: ClaudeProfileRepairWriteOps;
|
|
158
167
|
}): ClaudeProfileRepairResult;
|
|
159
168
|
/**
|
|
160
169
|
* @description Remove a profile's directory — its login with it. `fs.rmSync` removes the symlinks AS LINKS, so
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudeProfiles.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;
|
|
1
|
+
{"version":3,"file":"claudeProfiles.d.ts","sourceRoot":"","sources":["../../src/utils/claudeProfiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,EAAE,SAAS,EAAE,MAAM,cA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;AACtG,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAKjE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM7D;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKjF;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,CAAC;AAErE,uHAAuH;AACvH,wBAAgB,oBAAoB,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,iBAAiB,CAMvF;AAID,eAAO,MAAM,2BAA2B,sBAAsB,CAAC;AAE/D;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,UAAU,CAK3F;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAQ7F;AAED;;;;;;GAMG;AACH,wBAAgB,+BAA+B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAM9E"}
|
|
@@ -97,6 +97,7 @@ const fs = __importStar(require("fs"));
|
|
|
97
97
|
const os = __importStar(require("os"));
|
|
98
98
|
const path = __importStar(require("path"));
|
|
99
99
|
const agentEnvironment_1 = require("./agentEnvironment");
|
|
100
|
+
const dataDirFs_1 = require("../dataDirFs");
|
|
100
101
|
/** The profile that is `~/.claude` itself (no `CLAUDE_CONFIG_DIR`). */
|
|
101
102
|
exports.defaultClaudeProfileName = 'default';
|
|
102
103
|
/** Subdirectory of `DATA_DIR` that holds every profile's config directory. */
|
|
@@ -192,13 +193,13 @@ function createClaudeProfileLayout(input) {
|
|
|
192
193
|
const dir = resolveClaudeProfileDir(dataDir, name);
|
|
193
194
|
if (dir === null)
|
|
194
195
|
throw new Error('the default profile has no directory of its own');
|
|
195
|
-
|
|
196
|
-
|
|
196
|
+
dataDirFs_1.dataDirFs.mkdirSync(resolveClaudeProfilesRoot(dataDir), { recursive: true, mode: 0o700 });
|
|
197
|
+
dataDirFs_1.dataDirFs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
197
198
|
const dirStat = fs.statSync(dir);
|
|
198
199
|
// Only the owner may chmod (anyone else gets EPERM), and nothing is written when the mode is already right.
|
|
199
200
|
if (checkCanChmod(dirStat, input.uid === undefined ? readCurrentUid() : input.uid) && (dirStat.mode & 0o777) !== 0o700)
|
|
200
|
-
|
|
201
|
-
|
|
201
|
+
dataDirFs_1.dataDirFs.chmodSync(dir, 0o700);
|
|
202
|
+
dataDirFs_1.dataDirFs.mkdirSync(path.join(homeClaudeDir, 'projects'), { recursive: true });
|
|
202
203
|
repairClaudeProfileLayout({ dataDir, name, homeClaudeDir, uid: input.uid, isStrict: true });
|
|
203
204
|
return dir;
|
|
204
205
|
}
|
|
@@ -268,6 +269,7 @@ function isDanglingLink(linkPath) {
|
|
|
268
269
|
function repairClaudeProfileLayout(input) {
|
|
269
270
|
const { dataDir, name } = input;
|
|
270
271
|
const log = input.log ?? ((line) => console.warn(line));
|
|
272
|
+
const writeOps = input.writeOps ?? dataDirFs_1.dataDirFs;
|
|
271
273
|
const dir = resolveClaudeProfileDir(dataDir, name);
|
|
272
274
|
const skipped = { dir: null, status: 'skipped', actions: [], pending: [] };
|
|
273
275
|
if (dir === null || !checkIsValidClaudeProfileName(name))
|
|
@@ -333,14 +335,14 @@ function repairClaudeProfileLayout(input) {
|
|
|
333
335
|
let movedTo = null;
|
|
334
336
|
if (step.isMoveNeeded) {
|
|
335
337
|
movedTo = pickMovedAsideName(dir, step.entry, nowMs);
|
|
336
|
-
|
|
338
|
+
writeOps.renameSync(entryPath, path.join(dir, movedTo));
|
|
337
339
|
log(`[accounts] profile ${name}: ${step.entry} was ${step.found === 'wrongLink' ? 'a link to somewhere else' : `a ${step.found} of its own`}, not the link into ~/.claude — moved aside to ${movedTo}${step.target === null ? ' (~/.claude has no such entry)' : ''}`);
|
|
338
340
|
}
|
|
339
341
|
if (step.target !== null) {
|
|
340
342
|
if (step.entry === 'projects')
|
|
341
|
-
|
|
343
|
+
writeOps.mkdirSync(step.target, { recursive: true });
|
|
342
344
|
try {
|
|
343
|
-
|
|
345
|
+
writeOps.symlinkSync(step.target, entryPath);
|
|
344
346
|
}
|
|
345
347
|
catch (linkError) {
|
|
346
348
|
// Another process — the bot's watch of the profiles folder adopting this very folder, a CLI call — made the same link between the plan
|
|
@@ -426,7 +428,7 @@ function repairClaudeProfileFolderForLaunch(input) {
|
|
|
426
428
|
if (path.dirname(resolved) !== path.resolve(resolveClaudeProfilesRoot(input.dataDir)) || !checkIsValidClaudeProfileName(name))
|
|
427
429
|
return skipped;
|
|
428
430
|
try {
|
|
429
|
-
const result = repairClaudeProfileLayout({ dataDir: input.dataDir, name, homeClaudeDir: input.homeClaudeDir, uid: input.uid, now: input.now, log });
|
|
431
|
+
const result = repairClaudeProfileLayout({ dataDir: input.dataDir, name, homeClaudeDir: input.homeClaudeDir, uid: input.uid, now: input.now, log, writeOps: input.writeOps });
|
|
430
432
|
if (result.dir === null)
|
|
431
433
|
return result;
|
|
432
434
|
const stat = fs.statSync(path.join(result.dir, '.claude.json'), { throwIfNoEntry: false });
|
|
@@ -454,7 +456,7 @@ function removeClaudeProfileLayout(dataDir, name) {
|
|
|
454
456
|
const dir = resolveClaudeProfileDir(dataDir, name);
|
|
455
457
|
if (dir === null || !checkIsValidClaudeProfileName(name))
|
|
456
458
|
throw new Error(`cannot remove the Claude profile ${JSON.stringify(name)}`);
|
|
457
|
-
|
|
459
|
+
dataDirFs_1.dataDirFs.rmSync(dir, { recursive: true, force: true });
|
|
458
460
|
}
|
|
459
461
|
/**
|
|
460
462
|
* @description Sign `~/.claude` (the `default` account) out by deleting ONLY its subscription login: the
|
|
@@ -476,13 +478,13 @@ function signOutDefaultClaudeLogin(homeClaudeDir = resolveHomeClaudeDir()) {
|
|
|
476
478
|
const rest = { ...parsed };
|
|
477
479
|
delete rest.claudeAiOauth;
|
|
478
480
|
if (Object.keys(rest).length === 0) {
|
|
479
|
-
|
|
481
|
+
dataDirFs_1.dataDirFs.rmSync(file, { force: true });
|
|
480
482
|
return true;
|
|
481
483
|
}
|
|
482
484
|
const mode = fs.statSync(file).mode & 0o777;
|
|
483
485
|
const tmp = `${file}.${process.pid}.tmp`;
|
|
484
|
-
|
|
485
|
-
|
|
486
|
+
dataDirFs_1.dataDirFs.writeFileSync(tmp, JSON.stringify(rest), { mode });
|
|
487
|
+
dataDirFs_1.dataDirFs.renameSync(tmp, file);
|
|
486
488
|
return true;
|
|
487
489
|
}
|
|
488
490
|
/** Whether a profile's directory exists on disk (the login may still be missing — see the auth status). */
|
|
@@ -662,15 +664,15 @@ function checkHasClaudeProfileApiKey(configDir) {
|
|
|
662
664
|
function writeClaudeProfileApiKey(configDir, apiKey) {
|
|
663
665
|
const file = resolveClaudeProfileApiKeyFile(configDir);
|
|
664
666
|
const tmp = `${file}.${process.pid}.tmp`;
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
667
|
+
dataDirFs_1.dataDirFs.writeFileSync(tmp, `${apiKey.trim()}\n`, { mode: 0o600 });
|
|
668
|
+
dataDirFs_1.dataDirFs.chmodSync(tmp, 0o600);
|
|
669
|
+
dataDirFs_1.dataDirFs.renameSync(tmp, file);
|
|
668
670
|
}
|
|
669
671
|
/** Drop a profile's pasted key (and the launch settings that point at it); a missing file is fine. */
|
|
670
672
|
function removeClaudeProfileApiKey(configDir) {
|
|
671
|
-
|
|
673
|
+
dataDirFs_1.dataDirFs.rmSync(resolveClaudeProfileApiKeyFile(configDir), { force: true });
|
|
672
674
|
for (const fileName of [exports.claudeProfileLaunchSettingsFileName, ...Object.values(exports.claudeProfileSkillsRestoreSettingsFileNames)]) {
|
|
673
|
-
|
|
675
|
+
dataDirFs_1.dataDirFs.rmSync(path.join(configDir, fileName), { force: true });
|
|
674
676
|
}
|
|
675
677
|
}
|
|
676
678
|
/**
|