charness 3.11.0 → 3.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +5 -0
- package/CHANGELOG.md +169 -0
- package/DEVELOPMENT.md +81 -18
- package/README.md +3 -2
- package/SETUP.md +71 -25
- package/agent-plugin/README.md +15 -6
- package/agent-plugin/skills/charness-delegate-claude/SKILL.md +37 -18
- package/agent-plugin/skills/charness-delegate-opencode/SKILL.md +10 -6
- package/agent-plugin/skills/charness-delivery-loop/SKILL.md +92 -0
- package/agent-plugin/skills/charness-orchestration/SKILL.md +116 -0
- package/dist/accessControl.d.ts +43 -0
- package/dist/accessControl.d.ts.map +1 -1
- package/dist/accessControl.js +50 -1
- package/dist/accessControl.js.map +1 -1
- package/dist/adapters/claudeCliAdapter.d.ts.map +1 -1
- package/dist/adapters/claudeCliAdapter.js +9 -4
- package/dist/adapters/claudeCliAdapter.js.map +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js +1 -1
- package/dist/adapters/claudeJsonStreamAdapter.js.map +1 -1
- package/dist/adapters/claudePlatformFlags.d.ts +4 -3
- package/dist/adapters/claudePlatformFlags.d.ts.map +1 -1
- package/dist/adapters/claudePlatformFlags.js +4 -3
- package/dist/adapters/claudePlatformFlags.js.map +1 -1
- package/dist/adapters/openCodeAdapter.d.ts +52 -13
- package/dist/adapters/openCodeAdapter.d.ts.map +1 -1
- package/dist/adapters/openCodeAdapter.js +121 -45
- package/dist/adapters/openCodeAdapter.js.map +1 -1
- package/dist/adapters/terminalAdapter.d.ts.map +1 -1
- package/dist/adapters/terminalAdapter.js +5 -3
- package/dist/adapters/terminalAdapter.js.map +1 -1
- package/dist/agentLogin/agentLogin.d.ts +11 -0
- package/dist/agentLogin/agentLogin.d.ts.map +1 -1
- package/dist/agentLogin/agentLogin.js +20 -20
- package/dist/agentLogin/agentLogin.js.map +1 -1
- package/dist/apiErrorRetry.d.ts +5 -0
- package/dist/apiErrorRetry.d.ts.map +1 -1
- package/dist/apiErrorRetry.js +3 -3
- package/dist/apiErrorRetry.js.map +1 -1
- package/dist/bot.d.ts +12 -3
- package/dist/bot.d.ts.map +1 -1
- package/dist/bot.js +634 -153
- package/dist/bot.js.map +1 -1
- package/dist/cli/claudeProfiles.d.ts +5 -2
- package/dist/cli/claudeProfiles.d.ts.map +1 -1
- package/dist/cli/claudeProfiles.js +45 -22
- package/dist/cli/claudeProfiles.js.map +1 -1
- package/dist/cli/claudeProfilesCredit.d.ts +49 -0
- package/dist/cli/claudeProfilesCredit.d.ts.map +1 -0
- package/dist/cli/claudeProfilesCredit.js +160 -0
- package/dist/cli/claudeProfilesCredit.js.map +1 -0
- package/dist/cli/flagValue.d.ts +10 -0
- package/dist/cli/flagValue.d.ts.map +1 -0
- package/dist/cli/flagValue.js +17 -0
- package/dist/cli/flagValue.js.map +1 -0
- package/dist/connectors/jira/client.js +1 -1
- package/dist/connectors/jira/client.js.map +1 -1
- package/dist/connectors/jira/config.d.ts +7 -0
- package/dist/connectors/jira/config.d.ts.map +1 -1
- package/dist/connectors/jira/config.js +12 -1
- package/dist/connectors/jira/config.js.map +1 -1
- package/dist/connectors/jira/connector.d.ts +7 -0
- package/dist/connectors/jira/connector.d.ts.map +1 -1
- package/dist/connectors/jira/connector.js +20 -3
- package/dist/connectors/jira/connector.js.map +1 -1
- package/dist/connectors/jira/inbound.d.ts.map +1 -1
- package/dist/connectors/jira/inbound.js +4 -3
- package/dist/connectors/jira/inbound.js.map +1 -1
- package/dist/connectors/jira/issueBlocks.d.ts +1 -1
- package/dist/connectors/jira/trustedGroup.d.ts +21 -6
- package/dist/connectors/jira/trustedGroup.d.ts.map +1 -1
- package/dist/connectors/jira/trustedGroup.js +46 -6
- package/dist/connectors/jira/trustedGroup.js.map +1 -1
- package/dist/connectors/telegram/commands/botCore.d.ts +19 -2
- package/dist/connectors/telegram/commands/botCore.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/botSkills.js +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts +6 -1
- package/dist/connectors/telegram/commands/claudeAccounts.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/claudeAccounts.js +9 -6
- package/dist/connectors/telegram/commands/claudeAccounts.js.map +1 -1
- package/dist/connectors/telegram/commands/compaction.d.ts +16 -3
- package/dist/connectors/telegram/commands/compaction.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/compaction.js +216 -27
- package/dist/connectors/telegram/commands/compaction.js.map +1 -1
- package/dist/connectors/telegram/commands/runners.d.ts +5 -1
- package/dist/connectors/telegram/commands/runners.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/runners.js +146 -31
- package/dist/connectors/telegram/commands/runners.js.map +1 -1
- package/dist/connectors/telegram/commands/todo.d.ts.map +1 -1
- package/dist/connectors/telegram/commands/todo.js +2 -2
- package/dist/connectors/telegram/commands/todo.js.map +1 -1
- package/dist/connectors/telegram/commands/topicAccess.d.ts +30 -0
- package/dist/connectors/telegram/commands/topicAccess.d.ts.map +1 -0
- package/dist/connectors/telegram/commands/topicAccess.js +399 -0
- package/dist/connectors/telegram/commands/topicAccess.js.map +1 -0
- package/dist/connectors/telegram/inbound.d.ts +44 -7
- package/dist/connectors/telegram/inbound.d.ts.map +1 -1
- package/dist/connectors/telegram/inbound.js +142 -24
- package/dist/connectors/telegram/inbound.js.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.d.ts +2 -7
- package/dist/connectors/telegram/runnerPairingMessages.d.ts.map +1 -1
- package/dist/connectors/telegram/runnerPairingMessages.js +5 -19
- package/dist/connectors/telegram/runnerPairingMessages.js.map +1 -1
- package/dist/i18n/de.d.ts.map +1 -1
- package/dist/i18n/de.js +120 -8
- package/dist/i18n/de.js.map +1 -1
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +120 -8
- package/dist/i18n/en.js.map +1 -1
- package/dist/i18n/es.d.ts.map +1 -1
- package/dist/i18n/es.js +120 -8
- package/dist/i18n/es.js.map +1 -1
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +120 -8
- package/dist/i18n/fr.js.map +1 -1
- package/dist/i18n/hi.d.ts.map +1 -1
- package/dist/i18n/hi.js +120 -8
- package/dist/i18n/hi.js.map +1 -1
- package/dist/i18n/ja.d.ts.map +1 -1
- package/dist/i18n/ja.js +120 -8
- package/dist/i18n/ja.js.map +1 -1
- package/dist/i18n/ka.d.ts.map +1 -1
- package/dist/i18n/ka.js +120 -8
- package/dist/i18n/ka.js.map +1 -1
- package/dist/i18n/pt.d.ts.map +1 -1
- package/dist/i18n/pt.js +120 -8
- package/dist/i18n/pt.js.map +1 -1
- package/dist/i18n/ru.d.ts.map +1 -1
- package/dist/i18n/ru.js +120 -8
- package/dist/i18n/ru.js.map +1 -1
- package/dist/i18n/uk.d.ts.map +1 -1
- package/dist/i18n/uk.js +120 -8
- package/dist/i18n/uk.js.map +1 -1
- package/dist/i18n/uz.d.ts.map +1 -1
- package/dist/i18n/uz.js +120 -8
- package/dist/i18n/uz.js.map +1 -1
- package/dist/i18n/zh.d.ts.map +1 -1
- package/dist/i18n/zh.js +120 -8
- package/dist/i18n/zh.js.map +1 -1
- package/dist/installManager.d.ts +37 -1
- package/dist/installManager.d.ts.map +1 -1
- package/dist/installManager.js +208 -14
- package/dist/installManager.js.map +1 -1
- package/dist/instanceLock.d.ts.map +1 -1
- package/dist/instanceLock.js +2 -1
- package/dist/instanceLock.js.map +1 -1
- package/dist/platform/commandRouter.d.ts +13 -1
- package/dist/platform/commandRouter.d.ts.map +1 -1
- package/dist/platform/commandRouter.js +14 -2
- package/dist/platform/commandRouter.js.map +1 -1
- package/dist/platform/inbound.d.ts +2 -0
- package/dist/platform/inbound.d.ts.map +1 -1
- package/dist/platform/outbound.d.ts +14 -1
- package/dist/platform/outbound.d.ts.map +1 -1
- package/dist/platform/outbound.js.map +1 -1
- package/dist/remoteRun/cleanReport.d.ts +45 -0
- package/dist/remoteRun/cleanReport.d.ts.map +1 -0
- package/dist/remoteRun/cleanReport.js +84 -0
- package/dist/remoteRun/cleanReport.js.map +1 -0
- package/dist/remoteRun/cliArgs.d.ts +18 -0
- package/dist/remoteRun/cliArgs.d.ts.map +1 -1
- package/dist/remoteRun/cliArgs.js +100 -4
- package/dist/remoteRun/cliArgs.js.map +1 -1
- package/dist/remoteRun/commands.d.ts +30 -1
- package/dist/remoteRun/commands.d.ts.map +1 -1
- package/dist/remoteRun/commands.js +84 -9
- package/dist/remoteRun/commands.js.map +1 -1
- package/dist/remoteRun/exitCodes.d.ts +5 -0
- package/dist/remoteRun/exitCodes.d.ts.map +1 -1
- package/dist/remoteRun/exitCodes.js +6 -1
- package/dist/remoteRun/exitCodes.js.map +1 -1
- package/dist/remoteRun/foreground.d.ts +6 -0
- package/dist/remoteRun/foreground.d.ts.map +1 -1
- package/dist/remoteRun/foreground.js +13 -1
- package/dist/remoteRun/foreground.js.map +1 -1
- package/dist/remoteRun/interrupts.d.ts.map +1 -1
- package/dist/remoteRun/interrupts.js +2 -2
- package/dist/remoteRun/interrupts.js.map +1 -1
- package/dist/remoteRun/jobFiles.d.ts +6 -1
- package/dist/remoteRun/jobFiles.d.ts.map +1 -1
- package/dist/remoteRun/jobFiles.js +14 -0
- package/dist/remoteRun/jobFiles.js.map +1 -1
- package/dist/remoteRun/jobId.d.ts +5 -0
- package/dist/remoteRun/jobId.d.ts.map +1 -1
- package/dist/remoteRun/jobId.js +10 -0
- package/dist/remoteRun/jobId.js.map +1 -1
- package/dist/remoteRun/jobState.d.ts.map +1 -1
- package/dist/remoteRun/jobState.js +3 -2
- package/dist/remoteRun/jobState.js.map +1 -1
- package/dist/remoteRun/pairedRunners.d.ts +1 -1
- package/dist/remoteRun/pairedRunners.d.ts.map +1 -1
- package/dist/remoteRun/pairedRunners.js +4 -0
- package/dist/remoteRun/pairedRunners.js.map +1 -1
- package/dist/remoteRun/pathPatterns.d.ts +1 -1
- package/dist/remoteRun/pathPatterns.js +1 -1
- package/dist/remoteRun/probe.d.ts +58 -5
- package/dist/remoteRun/probe.d.ts.map +1 -1
- package/dist/remoteRun/probe.js +107 -11
- package/dist/remoteRun/probe.js.map +1 -1
- package/dist/remoteRun/probeTiming.d.ts +15 -0
- package/dist/remoteRun/probeTiming.d.ts.map +1 -0
- package/dist/remoteRun/probeTiming.js +23 -0
- package/dist/remoteRun/probeTiming.js.map +1 -0
- package/dist/remoteRun/project.d.ts +5 -0
- package/dist/remoteRun/project.d.ts.map +1 -1
- package/dist/remoteRun/project.js +10 -0
- package/dist/remoteRun/project.js.map +1 -1
- package/dist/remoteRun/projectConfig.d.ts +8 -1
- package/dist/remoteRun/projectConfig.d.ts.map +1 -1
- package/dist/remoteRun/projectConfig.js +18 -5
- package/dist/remoteRun/projectConfig.js.map +1 -1
- package/dist/remoteRun/pruneReport.d.ts +48 -0
- package/dist/remoteRun/pruneReport.d.ts.map +1 -0
- package/dist/remoteRun/pruneReport.js +80 -0
- package/dist/remoteRun/pruneReport.js.map +1 -0
- package/dist/remoteRun/remoteRunCli.d.ts +1 -1
- package/dist/remoteRun/remoteRunCli.d.ts.map +1 -1
- package/dist/remoteRun/remoteRunCli.js +20 -0
- package/dist/remoteRun/remoteRunCli.js.map +1 -1
- package/dist/remoteRun/runnerClient.d.ts +10 -0
- package/dist/remoteRun/runnerClient.d.ts.map +1 -1
- package/dist/remoteRun/runnerClient.js +19 -5
- package/dist/remoteRun/runnerClient.js.map +1 -1
- package/dist/remoteRun/runnerWait.d.ts.map +1 -1
- package/dist/remoteRun/runnerWait.js +2 -1
- package/dist/remoteRun/runnerWait.js.map +1 -1
- package/dist/remoteRun/runners.d.ts +48 -7
- package/dist/remoteRun/runners.d.ts.map +1 -1
- package/dist/remoteRun/runners.js +105 -40
- package/dist/remoteRun/runners.js.map +1 -1
- package/dist/remoteRun/runnersConfig.d.ts +24 -0
- package/dist/remoteRun/runnersConfig.d.ts.map +1 -1
- package/dist/remoteRun/runnersConfig.js +29 -2
- package/dist/remoteRun/runnersConfig.js.map +1 -1
- package/dist/remoteRun/ssh.d.ts +3 -3
- package/dist/remoteRun/ssh.d.ts.map +1 -1
- package/dist/remoteRun/ssh.js +19 -5
- package/dist/remoteRun/ssh.js.map +1 -1
- package/dist/remoteRun/submit.d.ts +1 -1
- package/dist/remoteRun/submit.d.ts.map +1 -1
- package/dist/remoteRun/submit.js +30 -2
- package/dist/remoteRun/submit.js.map +1 -1
- package/dist/runnerUtility/adminService.d.ts.map +1 -1
- package/dist/runnerUtility/adminService.js +5 -5
- package/dist/runnerUtility/adminService.js.map +1 -1
- package/dist/runnerUtility/appInstall.d.ts +9 -0
- package/dist/runnerUtility/appInstall.d.ts.map +1 -1
- package/dist/runnerUtility/appInstall.js +12 -2
- package/dist/runnerUtility/appInstall.js.map +1 -1
- package/dist/runnerUtility/execEnv.d.ts +1 -1
- package/dist/runnerUtility/execEnv.d.ts.map +1 -1
- package/dist/runnerUtility/execEnv.js +23 -5
- package/dist/runnerUtility/execEnv.js.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.d.ts +3 -3
- package/dist/runnerUtility/guiAgentHeal.d.ts.map +1 -1
- package/dist/runnerUtility/guiAgentHeal.js +4 -2
- package/dist/runnerUtility/guiAgentHeal.js.map +1 -1
- package/dist/runnerUtility/homeFolders.d.ts +1 -0
- package/dist/runnerUtility/homeFolders.d.ts.map +1 -1
- package/dist/runnerUtility/homeFolders.js +2 -1
- package/dist/runnerUtility/homeFolders.js.map +1 -1
- package/dist/runnerUtility/iosCheck.d.ts +2 -0
- package/dist/runnerUtility/iosCheck.d.ts.map +1 -1
- package/dist/runnerUtility/iosCheck.js +12 -3
- package/dist/runnerUtility/iosCheck.js.map +1 -1
- package/dist/runnerUtility/keepAwake.d.ts +47 -10
- package/dist/runnerUtility/keepAwake.d.ts.map +1 -1
- package/dist/runnerUtility/keepAwake.js +108 -31
- package/dist/runnerUtility/keepAwake.js.map +1 -1
- package/dist/runnerUtility/launcher.d.ts +4 -0
- package/dist/runnerUtility/launcher.d.ts.map +1 -1
- package/dist/runnerUtility/launcher.js +31 -13
- package/dist/runnerUtility/launcher.js.map +1 -1
- package/dist/runnerUtility/linkLoop.d.ts +4 -0
- package/dist/runnerUtility/linkLoop.d.ts.map +1 -1
- package/dist/runnerUtility/linkLoop.js +15 -6
- package/dist/runnerUtility/linkLoop.js.map +1 -1
- package/dist/runnerUtility/managedNode.d.ts +84 -0
- package/dist/runnerUtility/managedNode.d.ts.map +1 -0
- package/dist/runnerUtility/managedNode.js +165 -0
- package/dist/runnerUtility/managedNode.js.map +1 -0
- package/dist/runnerUtility/nodeOnPath.d.ts +10 -0
- package/dist/runnerUtility/nodeOnPath.d.ts.map +1 -0
- package/dist/runnerUtility/nodeOnPath.js +49 -0
- package/dist/runnerUtility/nodeOnPath.js.map +1 -0
- package/dist/runnerUtility/nodeUpkeep.d.ts +140 -0
- package/dist/runnerUtility/nodeUpkeep.d.ts.map +1 -0
- package/dist/runnerUtility/nodeUpkeep.js +348 -0
- package/dist/runnerUtility/nodeUpkeep.js.map +1 -0
- package/dist/runnerUtility/nodeUpkeepTiming.d.ts +14 -0
- package/dist/runnerUtility/nodeUpkeepTiming.d.ts.map +1 -0
- package/dist/runnerUtility/nodeUpkeepTiming.js +21 -0
- package/dist/runnerUtility/nodeUpkeepTiming.js.map +1 -0
- package/dist/runnerUtility/packageManagerShims.d.ts +10 -0
- package/dist/runnerUtility/packageManagerShims.d.ts.map +1 -1
- package/dist/runnerUtility/packageManagerShims.js +67 -3
- package/dist/runnerUtility/packageManagerShims.js.map +1 -1
- package/dist/runnerUtility/pueueDaemon.d.ts +73 -8
- package/dist/runnerUtility/pueueDaemon.d.ts.map +1 -1
- package/dist/runnerUtility/pueueDaemon.js +90 -15
- package/dist/runnerUtility/pueueDaemon.js.map +1 -1
- package/dist/runnerUtility/runnerCommands.d.ts +7 -1
- package/dist/runnerUtility/runnerCommands.d.ts.map +1 -1
- package/dist/runnerUtility/runnerCommands.js +119 -16
- package/dist/runnerUtility/runnerCommands.js.map +1 -1
- package/dist/runnerUtility/runnerHome.d.ts +34 -0
- package/dist/runnerUtility/runnerHome.d.ts.map +1 -1
- package/dist/runnerUtility/runnerHome.js +17 -3
- package/dist/runnerUtility/runnerHome.js.map +1 -1
- package/dist/runnerUtility/serviceCommon.d.ts +2 -0
- package/dist/runnerUtility/serviceCommon.d.ts.map +1 -1
- package/dist/runnerUtility/serviceCommon.js +3 -1
- package/dist/runnerUtility/serviceCommon.js.map +1 -1
- package/dist/runnerUtility/serviceManager.d.ts.map +1 -1
- package/dist/runnerUtility/serviceManager.js +7 -2
- package/dist/runnerUtility/serviceManager.js.map +1 -1
- package/dist/runnerUtility/simctlGuard.d.ts +38 -0
- package/dist/runnerUtility/simctlGuard.d.ts.map +1 -0
- package/dist/runnerUtility/simctlGuard.js +166 -0
- package/dist/runnerUtility/simctlGuard.js.map +1 -0
- package/dist/runners/bootstrapLine.d.ts +3 -4
- package/dist/runners/bootstrapLine.d.ts.map +1 -1
- package/dist/runners/bootstrapLine.js +108 -83
- package/dist/runners/bootstrapLine.js.map +1 -1
- package/dist/runners/hubPackage.d.ts +1 -1
- package/dist/runners/hubPackage.d.ts.map +1 -1
- package/dist/runners/hubPackage.js +5 -6
- package/dist/runners/hubPackage.js.map +1 -1
- package/dist/runners/hubPairing.d.ts +19 -0
- package/dist/runners/hubPairing.d.ts.map +1 -1
- package/dist/runners/hubPairing.js +38 -0
- package/dist/runners/hubPairing.js.map +1 -1
- package/dist/runners/hubRegistry.d.ts +8 -0
- package/dist/runners/hubRegistry.d.ts.map +1 -1
- package/dist/runners/hubRegistry.js +6 -0
- package/dist/runners/hubRegistry.js.map +1 -1
- package/dist/runners/pairCode.d.ts +34 -3
- package/dist/runners/pairCode.d.ts.map +1 -1
- package/dist/runners/pairCode.js +65 -13
- package/dist/runners/pairCode.js.map +1 -1
- package/dist/runners/runnerGroups.d.ts +22 -0
- package/dist/runners/runnerGroups.d.ts.map +1 -0
- package/dist/runners/runnerGroups.js +41 -0
- package/dist/runners/runnerGroups.js.map +1 -0
- package/dist/runners/runnerLock.d.ts +36 -1
- package/dist/runners/runnerLock.d.ts.map +1 -1
- package/dist/runners/runnerLock.js +94 -30
- package/dist/runners/runnerLock.js.map +1 -1
- package/dist/runners/runnersCli.d.ts +5 -2
- package/dist/runners/runnersCli.d.ts.map +1 -1
- package/dist/runners/runnersCli.js +59 -9
- package/dist/runners/runnersCli.js.map +1 -1
- package/dist/runners/runnersList.d.ts +1 -1
- package/dist/runners/runnersList.d.ts.map +1 -1
- package/dist/runners/runnersList.js +3 -1
- package/dist/runners/runnersList.js.map +1 -1
- package/dist/runners/runnersOverview.d.ts.map +1 -1
- package/dist/runners/runnersOverview.js +8 -4
- package/dist/runners/runnersOverview.js.map +1 -1
- package/dist/scheduler/checkRun.d.ts +0 -2
- package/dist/scheduler/checkRun.d.ts.map +1 -1
- package/dist/scheduler/checkRun.js +0 -10
- package/dist/scheduler/checkRun.js.map +1 -1
- package/dist/scheduler/checkStatus.d.ts +2 -0
- package/dist/scheduler/checkStatus.d.ts.map +1 -1
- package/dist/scheduler/checkStatus.js +5 -4
- package/dist/scheduler/checkStatus.js.map +1 -1
- package/dist/scheduler/delivery.d.ts +2 -1
- package/dist/scheduler/delivery.d.ts.map +1 -1
- package/dist/scheduler/delivery.js +5 -1
- package/dist/scheduler/delivery.js.map +1 -1
- package/dist/scheduler/mcpSurface.d.ts +7 -3
- package/dist/scheduler/mcpSurface.d.ts.map +1 -1
- package/dist/scheduler/mcpSurface.js +48 -22
- package/dist/scheduler/mcpSurface.js.map +1 -1
- package/dist/scheduler/workerWatch.d.ts +33 -10
- package/dist/scheduler/workerWatch.d.ts.map +1 -1
- package/dist/scheduler/workerWatch.js +37 -11
- package/dist/scheduler/workerWatch.js.map +1 -1
- package/dist/selfUpdate/bootRollback.d.ts.map +1 -1
- package/dist/selfUpdate/bootRollback.js +3 -2
- package/dist/selfUpdate/bootRollback.js.map +1 -1
- package/dist/selfUpdate/updateRuntime.d.ts.map +1 -1
- package/dist/selfUpdate/updateRuntime.js +6 -3
- package/dist/selfUpdate/updateRuntime.js.map +1 -1
- package/dist/state.d.ts +144 -2
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +257 -7
- package/dist/state.js.map +1 -1
- package/dist/testTimings.d.ts +6 -2
- package/dist/testTimings.d.ts.map +1 -1
- package/dist/testTimings.js +12 -1
- package/dist/testTimings.js.map +1 -1
- package/dist/threadContextPreamble.d.ts +15 -1
- package/dist/threadContextPreamble.d.ts.map +1 -1
- package/dist/threadContextPreamble.js +15 -3
- package/dist/threadContextPreamble.js.map +1 -1
- package/dist/threadRouting.d.ts +47 -4
- package/dist/threadRouting.d.ts.map +1 -1
- package/dist/threadRouting.js +31 -4
- package/dist/threadRouting.js.map +1 -1
- package/dist/todos/projects.d.ts +1 -1
- package/dist/todos/projects.d.ts.map +1 -1
- package/dist/todos/projects.js +3 -14
- package/dist/todos/projects.js.map +1 -1
- package/dist/topicTalkerMemory.d.ts +37 -0
- package/dist/topicTalkerMemory.d.ts.map +1 -0
- package/dist/topicTalkerMemory.js +61 -0
- package/dist/topicTalkerMemory.js.map +1 -0
- package/dist/topicTalkers.d.ts +123 -0
- package/dist/topicTalkers.d.ts.map +1 -0
- package/dist/topicTalkers.js +276 -0
- package/dist/topicTalkers.js.map +1 -0
- package/dist/types.d.ts +7 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.d.ts +23 -0
- package/dist/utils/agentEnvironment.d.ts.map +1 -1
- package/dist/utils/agentEnvironment.js +33 -1
- package/dist/utils/agentEnvironment.js.map +1 -1
- package/dist/utils/agentPlugin.d.ts +9 -3
- package/dist/utils/agentPlugin.d.ts.map +1 -1
- package/dist/utils/agentPlugin.js +13 -6
- package/dist/utils/agentPlugin.js.map +1 -1
- package/dist/utils/authorMark.d.ts +59 -0
- package/dist/utils/authorMark.d.ts.map +1 -0
- package/dist/utils/authorMark.js +86 -0
- package/dist/utils/authorMark.js.map +1 -0
- package/dist/utils/botSkills.d.ts +1 -1
- package/dist/utils/claudeApiAgentStop.d.ts +64 -0
- package/dist/utils/claudeApiAgentStop.d.ts.map +1 -0
- package/dist/utils/claudeApiAgentStop.js +85 -0
- package/dist/utils/claudeApiAgentStop.js.map +1 -0
- package/dist/utils/claudeApiCredit.d.ts +168 -0
- package/dist/utils/claudeApiCredit.d.ts.map +1 -0
- package/dist/utils/claudeApiCredit.js +260 -0
- package/dist/utils/claudeApiCredit.js.map +1 -0
- package/dist/utils/claudeApiCreditRecheck.d.ts +120 -0
- package/dist/utils/claudeApiCreditRecheck.d.ts.map +1 -0
- package/dist/utils/claudeApiCreditRecheck.js +173 -0
- package/dist/utils/claudeApiCreditRecheck.js.map +1 -0
- package/dist/utils/claudeCompactHook.d.ts +18 -10
- package/dist/utils/claudeCompactHook.d.ts.map +1 -1
- package/dist/utils/claudeCompactHook.js +35 -14
- package/dist/utils/claudeCompactHook.js.map +1 -1
- package/dist/utils/claudeLimitSwitch.d.ts +5 -1
- package/dist/utils/claudeLimitSwitch.d.ts.map +1 -1
- package/dist/utils/claudeLimitSwitch.js +6 -2
- package/dist/utils/claudeLimitSwitch.js.map +1 -1
- package/dist/utils/claudeProfileUsageLines.d.ts +14 -2
- package/dist/utils/claudeProfileUsageLines.d.ts.map +1 -1
- package/dist/utils/claudeProfileUsageLines.js +78 -7
- package/dist/utils/claudeProfileUsageLines.js.map +1 -1
- package/dist/utils/claudeProfileUsageViews.d.ts +46 -0
- package/dist/utils/claudeProfileUsageViews.d.ts.map +1 -0
- package/dist/utils/claudeProfileUsageViews.js +114 -0
- package/dist/utils/claudeProfileUsageViews.js.map +1 -0
- package/dist/utils/claudeProfiles.d.ts +22 -0
- package/dist/utils/claudeProfiles.d.ts.map +1 -1
- package/dist/utils/claudeProfiles.js +69 -0
- package/dist/utils/claudeProfiles.js.map +1 -1
- package/dist/utils/claudeUsage.d.ts +145 -51
- package/dist/utils/claudeUsage.d.ts.map +1 -1
- package/dist/utils/claudeUsage.js +211 -94
- package/dist/utils/claudeUsage.js.map +1 -1
- package/dist/utils/compactOnIdle.d.ts +140 -15
- package/dist/utils/compactOnIdle.d.ts.map +1 -1
- package/dist/utils/compactOnIdle.js +209 -23
- package/dist/utils/compactOnIdle.js.map +1 -1
- package/dist/utils/compactSelfReviewFlags.d.ts +50 -0
- package/dist/utils/compactSelfReviewFlags.d.ts.map +1 -0
- package/dist/utils/compactSelfReviewFlags.js +120 -0
- package/dist/utils/compactSelfReviewFlags.js.map +1 -0
- package/dist/utils/fallbackChain.d.ts +18 -7
- package/dist/utils/fallbackChain.d.ts.map +1 -1
- package/dist/utils/fallbackChain.js +36 -16
- package/dist/utils/fallbackChain.js.map +1 -1
- package/dist/utils/folderGit.d.ts +9 -0
- package/dist/utils/folderGit.d.ts.map +1 -0
- package/dist/utils/folderGit.js +33 -0
- package/dist/utils/folderGit.js.map +1 -0
- package/dist/utils/forwardedMark.d.ts +8 -0
- package/dist/utils/forwardedMark.d.ts.map +1 -1
- package/dist/utils/forwardedMark.js +2 -0
- package/dist/utils/forwardedMark.js.map +1 -1
- package/dist/utils/jsonStreamHost.d.ts +2 -1
- package/dist/utils/jsonStreamHost.d.ts.map +1 -1
- package/dist/utils/jsonStreamHost.js +4 -2
- package/dist/utils/jsonStreamHost.js.map +1 -1
- package/dist/utils/messageContext.d.ts +22 -7
- package/dist/utils/messageContext.d.ts.map +1 -1
- package/dist/utils/messageContext.js +19 -5
- package/dist/utils/messageContext.js.map +1 -1
- package/dist/utils/openCodeCompactPlugin.d.ts +28 -7
- package/dist/utils/openCodeCompactPlugin.d.ts.map +1 -1
- package/dist/utils/openCodeCompactPlugin.js +80 -15
- package/dist/utils/openCodeCompactPlugin.js.map +1 -1
- package/dist/utils/personLabel.d.ts +13 -0
- package/dist/utils/personLabel.d.ts.map +1 -0
- package/dist/utils/personLabel.js +15 -0
- package/dist/utils/personLabel.js.map +1 -0
- package/dist/utils/replyQuote.d.ts +17 -3
- package/dist/utils/replyQuote.d.ts.map +1 -1
- package/dist/utils/replyQuote.js +25 -2
- package/dist/utils/replyQuote.js.map +1 -1
- package/dist/utils/runnersScreenPlan.d.ts +51 -20
- package/dist/utils/runnersScreenPlan.d.ts.map +1 -1
- package/dist/utils/runnersScreenPlan.js +143 -28
- package/dist/utils/runnersScreenPlan.js.map +1 -1
- package/dist/utils/streamedCompactionSummary.d.ts +65 -0
- package/dist/utils/streamedCompactionSummary.d.ts.map +1 -0
- package/dist/utils/streamedCompactionSummary.js +108 -0
- package/dist/utils/streamedCompactionSummary.js.map +1 -0
- package/dist/utils/talkerAccess.d.ts +9 -0
- package/dist/utils/talkerAccess.d.ts.map +1 -0
- package/dist/utils/talkerAccess.js +20 -0
- package/dist/utils/talkerAccess.js.map +1 -0
- package/dist/utils/tmuxExec.d.ts +20 -8
- package/dist/utils/tmuxExec.d.ts.map +1 -1
- package/dist/utils/tmuxExec.js +27 -7
- package/dist/utils/tmuxExec.js.map +1 -1
- package/dist/utils/topicAccessScreenPlan.d.ts +253 -0
- package/dist/utils/topicAccessScreenPlan.d.ts.map +1 -0
- package/dist/utils/topicAccessScreenPlan.js +287 -0
- package/dist/utils/topicAccessScreenPlan.js.map +1 -0
- package/dist/utils/topicLabel.d.ts +12 -0
- package/dist/utils/topicLabel.d.ts.map +1 -0
- package/dist/utils/topicLabel.js +12 -0
- package/dist/utils/topicLabel.js.map +1 -0
- package/dist/utils/topicRequest.d.ts +8 -5
- package/dist/utils/topicRequest.d.ts.map +1 -1
- package/dist/utils/topicRequest.js +9 -7
- package/dist/utils/topicRequest.js.map +1 -1
- package/npm-shrinkwrap.json +1003 -0
- package/package.json +5 -3
- package/remoteRun/ensureNode.sh +288 -0
- package/remoteRun/runner.sh +2252 -115
- package/agent-plugin/skills/charness-manager/SKILL.md +0 -157
- package/remoteRun/pickNode.sh +0 -65
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: charness-manager
|
|
3
|
-
description: "In a Charness-run session (the bot's MCP tools such as schedule_create, answer_request, claude_profiles are present) use this INSTEAD of any other manager skill before you dispatch, watch or resume a worker — a detached `claude -p` or `opencode run` builder, reviewer, researcher or planner — and whenever the user calls you the manager. Drives a plan to done without writing code yourself, and watches every worker with a bot check that fires when the worker exits OR stalls."
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Manager in a Charness session
|
|
7
|
-
|
|
8
|
-
You orchestrate: workers build, test, review and commit; you decide, keep the plan honest and keep the user
|
|
9
|
-
informed. You never write product code and never review a diff yourself.
|
|
10
|
-
|
|
11
|
-
## Modes
|
|
12
|
-
|
|
13
|
-
- **autonomous** — the default for a scheduled or unattended run, or when the user says so. Drive a READY plan
|
|
14
|
-
(no draft marker, no open questions); ask nothing; decide from the plan and the project rules; stop and report
|
|
15
|
-
what you cannot resolve. Without a named plan pick one ready plan that a worker can finish alone (the oldest by
|
|
16
|
-
its file date); none → say "nothing to do" and stop.
|
|
17
|
-
- **interactive** — the user is talking to you. Answer their question first, decide every point yourself and list
|
|
18
|
-
the decisions for them to correct, ask only about a fork you could not resolve.
|
|
19
|
-
|
|
20
|
-
## Rules that never bend
|
|
21
|
-
|
|
22
|
-
- Never force-push, tag, bump a version or merge a merge request.
|
|
23
|
-
- You check a worker's result only through another agent's report, `git log`, `git show --stat` and the plan's
|
|
24
|
-
checkboxes — never by reading its code, running its tests or re-running its e2e yourself.
|
|
25
|
-
- Parallel by default, on the same checkout — no worktree needed: reviewers and researchers run without limit
|
|
26
|
-
alongside everything else; several builders run at once when they edit independent parts of the code (name
|
|
27
|
-
each one's area in its brief; two tasks touching the same file queue).
|
|
28
|
-
- Serialize only what shares state: builds, test runs (devices, ports, e2e lanes — through their locks) and
|
|
29
|
-
commits (one at a time, path-limited). Two workers never share a file, a port, a browser profile or a device at
|
|
30
|
-
once. Every new ask joins the queue the moment it is said; start it at once when nothing it needs is taken,
|
|
31
|
-
else tell the user its place.
|
|
32
|
-
- A change the user can see is done only with a real end-to-end test that ran and passed. Never accept a stub, a
|
|
33
|
-
lower-level substitute or "test debt".
|
|
34
|
-
- Interactive: a commit YOU make yourself (a plan edit, bookkeeping) needs the user's yes first; workers commit
|
|
35
|
-
their own work without asking.
|
|
36
|
-
|
|
37
|
-
## Launching workers
|
|
38
|
-
|
|
39
|
-
- Load `charness-delegate-claude` or `charness-delegate-opencode` before the first launch and follow it: the CLI the
|
|
40
|
-
user named, otherwise the CLI you run in.
|
|
41
|
-
- Brief for a ready plan: its path, "implement it yourself, spawn no sub-agents", and — when several scopes go to
|
|
42
|
-
one builder — "your scopes are one batch: test each pointwise (unit tests and only its own new or changed e2e
|
|
43
|
-
flows), the full suites run once at the finish".
|
|
44
|
-
- Brief without a plan: like a colleague who just walked in — the goal, file paths, what to change and why. Never
|
|
45
|
-
"based on your findings, implement it".
|
|
46
|
-
- Name the skills the worker must load, never their content, and never restate project rules. Name every resource
|
|
47
|
-
another live process holds (a checkout, a port, a device).
|
|
48
|
-
- Role skills such as `developer`, `task-review`, `review`, `commit`: name them when the project offers them.
|
|
49
|
-
Otherwise state the role in words — builder: implement, test, self-review, commit each scope, no push;
|
|
50
|
-
reviewer: read the commit range against the plan or the user's asks and report findings, change nothing.
|
|
51
|
-
- Reuse the warm session: rework, the next small scope, or the next role on the same task resumes the SAME worker
|
|
52
|
-
session instead of starting a fresh one.
|
|
53
|
-
|
|
54
|
-
## Watch every worker with a bot check
|
|
55
|
-
|
|
56
|
-
Right after each launch, create ONE check for that worker run with `schedule_create`: cron `*/5 * * * *`,
|
|
57
|
-
`statusWorkerRunDir: "<run-dir>", statusEveryMinutes: 15`, a name like `watch <role> <scope>`, and this
|
|
58
|
-
`checkCommand` with the real PID and run directory:
|
|
59
|
-
|
|
60
|
-
```
|
|
61
|
-
kill -0 <pid> 2>/dev/null || { echo "worker <pid> exited"; exit 1; }; [ -n "$(find "<run-dir>" -mmin -45 -print -quit)" ] || { echo "<run-dir>: no change for 45 min"; exit 2; }
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
- It fails on EITHER signal: the worker's process is gone, or nothing in its run directory changed for 45
|
|
65
|
-
minutes. A check that only runs `kill -0 <pid>` never fires on a hung worker — never arm one.
|
|
66
|
-
- When it fires the topic gets one silent sentence («Worker "<role> <scope>" finished (2 h 5 min)» or «… silent for
|
|
67
|
-
45 min»), never the command and never a pin — a worker that simply finished fires it too. What the user must
|
|
68
|
-
notice you ask as a question.
|
|
69
|
-
- The status arguments make the BOT post a silent status line into the topic every 15 minutes while the check
|
|
70
|
-
passes (`⏳ <name> · works 30 min · now: <the worker's last action>`), replacing the previous one — no wake, no
|
|
71
|
-
tokens, so the topic never looks frozen while you are away. Never arm a schedule of your own for status lines.
|
|
72
|
-
- The run directory is where the worker writes all the time (its event log). A worker that runs one long command
|
|
73
|
-
may write nothing for a while: add the folder that command writes to (`find "<run-dir>" "<test-output-dir>" …`).
|
|
74
|
-
- The check's `prompt` must stand on its own — the wake may reach a resumed or compacted you: the role, the scope
|
|
75
|
-
or plan path, PID, session id, run directory, and "read the result, decide, then cancel this check".
|
|
76
|
-
- The first failure is ALSO the "worker finished" signal. On the wake read the worker's result first (its final
|
|
77
|
-
event, its exit, the end of its log), then decide: finished → the next step of the loop; stalled → look at its
|
|
78
|
-
last tool call, stop it, resume the same session; stopped by a usage limit → resume it at once on another account
|
|
79
|
-
(Accounts and usage limits).
|
|
80
|
-
- Then cancel the check (`schedule_list` → `schedule_cancel`) — that also deletes its status line, so a finished
|
|
81
|
-
worker leaves nothing behind. A new run gets a new check.
|
|
82
|
-
- Never build your own watcher: no sleep loop, `CronCreate`, `ScheduleWakeup`, background job or tmux pane. They
|
|
83
|
-
live in your process, which the bot stops after an idle stretch.
|
|
84
|
-
|
|
85
|
-
## Between wakes
|
|
86
|
-
|
|
87
|
-
- After launching a worker and arming its check, write the worker state into the plan or draft (PID, session id,
|
|
88
|
-
account profile name, run directory, scope, check name), then END your turn. The bot stops an idle agent process and resumes the
|
|
89
|
-
conversation when the check wakes it; you lose nothing that is written down.
|
|
90
|
-
- Start workers with `setsid nohup` (the delegate skills show the command), so stopping your own process never
|
|
91
|
-
takes a worker down.
|
|
92
|
-
- A worker must never hand back a run it has not read: one that ended its turn with a build or test still in
|
|
93
|
-
flight is resumed to wait for it, read it and finish.
|
|
94
|
-
|
|
95
|
-
## Delivery loop — a ready plan
|
|
96
|
-
|
|
97
|
-
1. **Build.** One builder for the whole plan (or a group of small scopes); it commits each scope as it is green.
|
|
98
|
-
A large or risky scope, or an independent part running in parallel, may get a builder of its own.
|
|
99
|
-
2. **Bookkeeping.** A finished scope flips its `[x]`; the commit that flips the plan's last box also moves the
|
|
100
|
-
plan file to `completed/`.
|
|
101
|
-
3. **Finish — only when the whole task is done, never per scope:**
|
|
102
|
-
1. A fresh reviewer reviews ALL the task's commits once. Its brief: the plan path or the user's asks nearly
|
|
103
|
-
verbatim, and the commit range — nothing else. Findings go back to a builder as rework, then a new review.
|
|
104
|
-
2. Clean → a builder runs ALL test suites in full and fixes every failure.
|
|
105
|
-
3. Any fixes in 2 → a separate reviewer reviews just those fixes; a change it makes sends you back to 2.
|
|
106
|
-
Each loop runs up to 20 cycles while the findings are concrete local fixes, telling the user about each cycle
|
|
107
|
-
past the third — even when new findings keep landing in the same area. A major finding, or the 20 cycles used
|
|
108
|
-
up: stop, leave the work for inspection, report. Never propose cutting the agreed scope to escape the loop.
|
|
109
|
-
4. **Push** only when the user allowed it (in chat or in their own instructions); otherwise report it ready to
|
|
110
|
-
push — as a question the user will notice (below).
|
|
111
|
-
|
|
112
|
-
## No plan yet — interactive
|
|
113
|
-
|
|
114
|
-
- **Bugs and small reworks:** capture each into a living plan the moment it is said (stable ids, never renumber,
|
|
115
|
-
never drop a deferral). An unambiguous one goes to a builder at once; only a fork you cannot resolve goes to
|
|
116
|
-
the user first.
|
|
117
|
-
- **A feature or idea:** capture a draft; a researcher worker investigates the code and the web, decides every
|
|
118
|
-
point itself and returns a summary, its decisions and only the forks it could not resolve. Show them, record
|
|
119
|
-
the locked decisions, and ask before switching to building.
|
|
120
|
-
|
|
121
|
-
## Accounts and usage limits
|
|
122
|
-
|
|
123
|
-
- Before every Claude worker launch call `claude_profiles` with the worker's model and start the worker with
|
|
124
|
-
`CLAUDE_CONFIG_DIR=<configDir>` of `recommended` (nothing when it is null). A new worker goes to the account whose
|
|
125
|
-
weekly limit resets soonest. Never launch on an account billed to API credits unless the user asked.
|
|
126
|
-
- Record the profile name beside the worker's session id. Every resume calls `claude_profiles` with
|
|
127
|
-
`currentProfile` = that name, so a warm worker stays on its account.
|
|
128
|
-
- A worker stopped by a usage limit resumes its SAME session at once, never a fresh worker (which would redo the
|
|
129
|
-
work): call `claude_profiles` with `currentProfile` and `isStoppedByLimit: true` and resume under the account it
|
|
130
|
-
recommends. `recommended: null` → nothing is usable: `schedule_create` a one-off resume (`onceAt` =
|
|
131
|
-
`nextAvailable.at`) whose prompt stands on its own. `nextAvailable` null too → no account names a time it frees
|
|
132
|
-
up: ask the user a native question (nothing can run) and `schedule_create` the same one-off retry about 30
|
|
133
|
-
minutes ahead.
|
|
134
|
-
- Your own usage limit is the bot's business: it waits or switches and then wakes you.
|
|
135
|
-
|
|
136
|
-
## Talking to the user
|
|
137
|
-
|
|
138
|
-
- The user keeps the bot's topics muted: your plain text reaches the topic silently. Anything they must notice —
|
|
139
|
-
a blocker, a fork, "ready to push" — ask as a native question (Claude Code: `AskUserQuestion`; OpenCode: its
|
|
140
|
-
question tool); the bot pins it, and the pin notifies. In autonomous mode stop and report instead.
|
|
141
|
-
- A message headed `[Request <id> · from: …]` is answered through `answer_request` (`progress`, `question`,
|
|
142
|
-
`final`); do not repeat its text as plain text afterwards.
|
|
143
|
-
- The passing-run video of a new e2e test → `send_file_to_user` (H.264 `.mp4`, sent as a video). Several
|
|
144
|
-
separate items, e.g. one per finished scope → `send_messages_to_user`.
|
|
145
|
-
- Work the user wants later → `schedule_create` with `onceAt` and a prompt that stands on its own.
|
|
146
|
-
- Write for a non-technical reader: the status, then the next steps as a short numbered list of who does what.
|
|
147
|
-
|
|
148
|
-
## A tracker conversation (Jira)
|
|
149
|
-
|
|
150
|
-
There are no `schedule_*` tools and nothing will wake you. Do not end your turn while a worker runs: wait in the
|
|
151
|
-
turn with foreground polls of at most 10 minutes each, checking the same two signals (the PID, the run directory
|
|
152
|
-
changing), report interim progress with `answer_request` kind `progress`, and end with kind `final`.
|
|
153
|
-
|
|
154
|
-
## Finally
|
|
155
|
-
|
|
156
|
-
Confirm from the reports that every changed file is listed, verification passed, the reviews are clean and the
|
|
157
|
-
plan is archived. Blocked or incomplete → leave the plan as it is for inspection. Report one line of outcome.
|
package/remoteRun/pickNode.sh
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
#!/bin/sh
|
|
2
|
-
# pickNode.sh <account> — run as ROOT by the admin pairing line, from its root-owned copy of the package (never from the account's folder), BEFORE
|
|
3
|
-
# anything is started under Node. Prints the real path of the Node.js that root and the runner's service will run under, or says why there is none
|
|
4
|
-
# (exit 1). A Node qualifies only when ALL of these hold:
|
|
5
|
-
# - its real path (links followed) is outside every home folder: /Users/<name>, /home/<name>, root's own. A program in a home is the other user's to
|
|
6
|
-
# change, and the runner's launcher and daemons would stop working the day that home is closed (chmod 700) or its version manager moves on;
|
|
7
|
-
# - the account can run it (`sudo -u <account> test -x`) and CANNOT write it, nor any folder above it (`test -w`): root runs it, and root must never
|
|
8
|
-
# execute anything the account — which runs the agents' code — can change;
|
|
9
|
-
# - it is Node.js 22.12 or newer.
|
|
10
|
-
# Candidates: the `node` of sudo's own PATH first, then Homebrew's (Apple Silicon, Intel).
|
|
11
|
-
#
|
|
12
|
-
# The account is judged with `sudo -u <account> test …` only: nothing of the account's is executed. `$1` is validated by the line (a plain account name).
|
|
13
|
-
# Test seam, used by the unit tests and not by the line: `$2` replaces the home patterns (space-separated `case` patterns), `$3` the system candidates.
|
|
14
|
-
set -u
|
|
15
|
-
a=$1
|
|
16
|
-
homes=${2:-"/Users/* /home/* */root/*"}
|
|
17
|
-
candidates=${3:-"/opt/homebrew/bin/node /usr/local/bin/node"}
|
|
18
|
-
min_major=22
|
|
19
|
-
min_minor=12
|
|
20
|
-
|
|
21
|
-
fail() { echo "charness-runner: $*" >&2; exit 1; }
|
|
22
|
-
|
|
23
|
-
# The real path of $1, links followed. Without `readlink -f` (macOS before 12.3) the links are followed by hand and the folder is resolved by `cd -P`.
|
|
24
|
-
real_path() {
|
|
25
|
-
readlink -f "$1" 2>/dev/null && return 0
|
|
26
|
-
p=$1; hops=0
|
|
27
|
-
while [ -L "$p" ] && [ "$hops" -lt 20 ]; do
|
|
28
|
-
l=$(readlink "$p") || return 1
|
|
29
|
-
case $l in /*) p=$l;; *) p=${p%/*}/$l;; esac
|
|
30
|
-
hops=$((hops + 1))
|
|
31
|
-
done
|
|
32
|
-
[ -e "$p" ] || return 1
|
|
33
|
-
d=$(cd -P "$(dirname "$p")" 2>/dev/null && pwd -P) || return 1
|
|
34
|
-
printf '%s/%s\n' "$d" "${p##*/}"
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
# Is $1, or a folder above it, writable by the account?
|
|
38
|
-
account_can_write() {
|
|
39
|
-
w=$1
|
|
40
|
-
while [ -n "$w" ] && [ "$w" != / ]; do
|
|
41
|
-
sudo -u "$a" test -w "$w" && return 0
|
|
42
|
-
w=${w%/*}
|
|
43
|
-
done
|
|
44
|
-
return 1
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
in_a_home() {
|
|
48
|
-
set -f
|
|
49
|
-
for pattern in $homes; do
|
|
50
|
-
case $1 in $pattern) set +f; return 0;; esac
|
|
51
|
-
done
|
|
52
|
-
set +f
|
|
53
|
-
return 1
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
for c in $(command -v node 2>/dev/null) $candidates; do
|
|
57
|
-
r=$(real_path "$c") || continue
|
|
58
|
-
in_a_home "$r" && continue
|
|
59
|
-
sudo -u "$a" test -x "$r" || continue
|
|
60
|
-
account_can_write "$r" && continue
|
|
61
|
-
"$r" -e "var v=process.versions.node.split(/[.]/);process.exit(v[0]>$min_major||v[0]==$min_major&&v[1]>=$min_minor?0:1)" || continue
|
|
62
|
-
printf '%s\n' "$r"
|
|
63
|
-
exit 0
|
|
64
|
-
done
|
|
65
|
-
fail "no Node.js $min_major.$min_minor+ outside home folders that $a cannot write: install one system-wide (macOS: brew install node), paste again"
|