@liangjie559567/ultrapower 5.6.6 → 5.6.8
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/LICENSE +21 -21
- package/README.es.md +81 -40
- package/README.ja.md +82 -41
- package/README.ko.md +81 -40
- package/README.md +98 -56
- package/README.pt.md +74 -39
- package/README.vi.md +74 -39
- package/README.zh.md +82 -41
- package/agents/AGENTS.md +24 -12
- package/agents/analyst.md +15 -7
- package/agents/architect.md +37 -18
- package/agents/axiom-context-manager.md +1 -1
- package/agents/axiom-critic.md +27 -13
- package/agents/axiom-domain-expert.md +25 -12
- package/agents/axiom-evolution-engine.md +2 -2
- package/agents/axiom-product-director.md +31 -15
- package/agents/axiom-sub-prd-writer.md +37 -16
- package/agents/axiom-tech-lead.md +35 -17
- package/agents/axiom-ux-director.md +27 -13
- package/agents/code-reviewer.md +5 -5
- package/agents/critic.md +17 -8
- package/agents/dependency-expert.md +2 -2
- package/agents/document-specialist.md +1 -1
- package/agents/information-architect.md +129 -60
- package/agents/planner.md +1 -1
- package/agents/product-analyst.md +137 -66
- package/agents/product-manager.md +180 -80
- package/agents/quality-strategist.md +123 -56
- package/agents/ux-researcher.md +151 -66
- package/agents/writer.md +10 -2
- package/bridge/AGENTS.md +26 -13
- package/bridge/codex-server.cjs +2 -2
- package/bridge/gemini-server.cjs +1 -1
- package/bridge/gyoshu_bridge.py +846 -846
- package/commands/AGENTS.md +16 -8
- package/commands/ccg-workflow.md +8 -4
- package/dist/mcp/adapters/memory-adapter.d.ts +1 -1
- package/dist/mcp/adapters/state-adapter.d.ts +6 -6
- package/dist/mcp/adapters/trace-adapter.d.ts +2 -2
- package/dist/mcp/config/schema.d.ts +3 -3
- package/dist/mcp/config-schema.d.ts +3 -3
- package/docs/AGENTS.md +19 -10
- package/docs/ANALYTICS-SYSTEM.md +57 -26
- package/docs/ARCHITECTURE.md +42 -29
- package/docs/AXIOM.md +117 -32
- package/docs/CJK-IME-KNOWN-ISSUES.md +67 -32
- package/docs/CLAUDE.md +288 -144
- package/docs/COMPATIBILITY.md +142 -81
- package/docs/DELEGATION-ENFORCER.md +27 -16
- package/docs/DOCUMENTATION_UPDATE_SUMMARY.md +25 -16
- package/docs/EVOLUTION.md +132 -62
- package/docs/FAQ.md +104 -45
- package/docs/FEATURES.md +122 -71
- package/docs/INSTALL.md +105 -35
- package/docs/INSTALL_FIX_SUMMARY.md +45 -23
- package/docs/INSTALL_FIX_VERIFICATION.md +7 -1
- package/docs/INSTALL_VERIFICATION_REPORT.md +31 -16
- package/docs/KNOWN_ISSUES.md +24 -7
- package/docs/LOCAL_INSTALL_VERIFICATION.md +44 -15
- package/docs/LOCAL_PLUGIN_INSTALL.md +27 -6
- package/docs/LOCAL_TEST_INSTALL_REPORT.md +10 -4
- package/docs/MAIN_DOCS_UPDATE_REPORT.md +26 -13
- package/docs/MIGRATION.md +340 -168
- package/docs/MIGRATION_GUIDE_v5.5.18.md +26 -10
- package/docs/NEXUS.md +79 -43
- package/docs/OMC-CLAUDE.md +274 -137
- package/docs/PERFORMANCE-MONITORING.md +73 -35
- package/docs/PLUGIN_MARKETPLACE_VERIFICATION.md +23 -8
- package/docs/QUICKSTART.md +10 -7
- package/docs/README.codex.md +17 -12
- package/docs/README.md +63 -29
- package/docs/README.opencode.md +66 -24
- package/docs/REFERENCE.md +182 -104
- package/docs/RELEASE.md +21 -11
- package/docs/RELEASE_GUIDE.md +71 -23
- package/docs/RELEASE_NOTES_v5.5.14.md +47 -24
- package/docs/RELEASE_RECOVERY.md +24 -8
- package/docs/RELEASE_SUMMARY_v5.5.18.md +44 -24
- package/docs/SYNC-SYSTEM.md +74 -35
- package/docs/TIERED_AGENTS_V2.md +203 -106
- package/docs/TUTORIAL.md +49 -18
- package/docs/UPGRADE_VERIFICATION.md +73 -17
- package/docs/UPGRADE_VERIFICATION_REPORT.md +25 -9
- package/docs/USER_GUIDE.md +337 -107
- package/docs/VALIDATION_REPORT.md +138 -68
- package/docs/VERIFICATION_SUMMARY.md +46 -25
- package/docs/adr/001-worker-state-adapter.md +96 -50
- package/docs/adr/002-caching-strategy.md +46 -25
- package/docs/adr/003-gradual-migration.md +113 -56
- package/docs/adr/template.md +47 -23
- package/docs/agent-templates/AGENTS.md +10 -5
- package/docs/agent-templates/README.md +54 -29
- package/docs/agent-templates/base-agent.md +49 -23
- package/docs/agent-templates/tier-instructions.md +51 -25
- package/docs/api/assets/highlight.css +85 -85
- package/docs/api/assets/style.css +1633 -1633
- package/docs/api/classes/ContextCollector.html +21 -21
- package/docs/api/functions/activateUltrawork.html +2 -2
- package/docs/api/functions/addCustomNote.html +5 -5
- package/docs/api/functions/addDirective.html +2 -2
- package/docs/api/functions/addManualEntry.html +2 -2
- package/docs/api/functions/addPattern.html +3 -3
- package/docs/api/functions/addWorker.html +2 -2
- package/docs/api/functions/addWorkingMemoryEntry.html +2 -2
- package/docs/api/functions/analyzeContextUsage.html +2 -2
- package/docs/api/functions/appendProgress.html +2 -2
- package/docs/api/functions/appendSessionId.html +2 -2
- package/docs/api/functions/applyCommentFilters.html +3 -3
- package/docs/api/functions/assignFileToWorker.html +2 -2
- package/docs/api/functions/backgroundUpdateCheck.html +2 -2
- package/docs/api/functions/buildAxiomBootContext.html +1 -1
- package/docs/api/functions/buildBoulderContinuation.html +2 -2
- package/docs/api/functions/buildDelegationTable.html +2 -2
- package/docs/api/functions/buildKeyTriggersSection.html +2 -2
- package/docs/api/functions/buildOrchestratorReminder.html +2 -2
- package/docs/api/functions/buildUseAvoidSection.html +2 -2
- package/docs/api/functions/buildVerificationReminder.html +2 -2
- package/docs/api/functions/canResumeAutopilot.html +10 -10
- package/docs/api/functions/canStartMode.html +5 -5
- package/docs/api/functions/cancelAutopilot.html +3 -3
- package/docs/api/functions/cancelUltraQA.html +2 -2
- package/docs/api/functions/checkBackgroundNotifications.html +2 -2
- package/docs/api/functions/checkBoulderContinuation.html +2 -2
- package/docs/api/functions/checkDuplicateTriggers.html +2 -2
- package/docs/api/functions/checkExpertGate.html +1 -1
- package/docs/api/functions/checkForComments.html +2 -2
- package/docs/api/functions/checkForUpdates.html +2 -2
- package/docs/api/functions/checkIncompleteTodos.html +13 -13
- package/docs/api/functions/checkPersistentModes.html +3 -3
- package/docs/api/functions/cleanupOrphanedState.html +2 -2
- package/docs/api/functions/cleanupStaleAgents.html +2 -2
- package/docs/api/functions/cleanupTransientState.html +2 -2
- package/docs/api/functions/clearAgentUsageState.html +1 -1
- package/docs/api/functions/clearAllModeStates.html +2 -2
- package/docs/api/functions/clearAutopilot.html +2 -2
- package/docs/api/functions/clearAutopilotState.html +2 -2
- package/docs/api/functions/clearBeadsContext.html +2 -2
- package/docs/api/functions/clearBoulderState.html +2 -2
- package/docs/api/functions/clearDetectionState.html +2 -2
- package/docs/api/functions/clearInjectedPaths.html +2 -2
- package/docs/api/functions/clearInjectedRules.html +2 -2
- package/docs/api/functions/clearLinkedUltraworkState.html +2 -2
- package/docs/api/functions/clearModeState.html +10 -10
- package/docs/api/functions/clearProjectMemorySession.html +4 -4
- package/docs/api/functions/clearRalphState.html +2 -2
- package/docs/api/functions/clearRapidFireDebounce.html +2 -2
- package/docs/api/functions/clearSkillSession.html +2 -2
- package/docs/api/functions/clearThinkModeState.html +2 -2
- package/docs/api/functions/clearTrackingState.html +2 -2
- package/docs/api/functions/clearUltraQAState.html +2 -2
- package/docs/api/functions/clearVerificationState.html +3 -3
- package/docs/api/functions/commandExists.html +2 -2
- package/docs/api/functions/compareVersions.html +3 -3
- package/docs/api/functions/completeUltraQA.html +2 -2
- package/docs/api/functions/completeUltrapilot.html +2 -2
- package/docs/api/functions/completeWorker.html +2 -2
- package/docs/api/functions/containsTokenLimitError.html +2 -2
- package/docs/api/functions/createAgentToolRestrictions.html +3 -3
- package/docs/api/functions/createAgentUsageReminderHook.html +1 -1
- package/docs/api/functions/createAutoSlashCommandHook.html +7 -7
- package/docs/api/functions/createBackgroundNotificationHook.html +7 -7
- package/docs/api/functions/createBackgroundTaskManager.html +2 -2
- package/docs/api/functions/createBoulderState.html +2 -2
- package/docs/api/functions/createCommentCheckerHook.html +6 -6
- package/docs/api/functions/createCompactCheckpoint.html +2 -2
- package/docs/api/functions/createContentHash.html +2 -2
- package/docs/api/functions/createContextInjectorHook.html +7 -7
- package/docs/api/functions/createDirectoryReadmeInjectorHook.html +9 -9
- package/docs/api/functions/createEmptyMessageSanitizerHook.html +6 -6
- package/docs/api/functions/createEnvContext.html +2 -2
- package/docs/api/functions/createHookOutput.html +4 -4
- package/docs/api/functions/createLearnedSkillsHook.html +6 -6
- package/docs/api/functions/createMagicKeywordProcessor.html +2 -2
- package/docs/api/functions/createModeMarker.html +6 -6
- package/docs/api/functions/createPrd.html +2 -2
- package/docs/api/functions/createPreemptiveCompactionHook.html +6 -6
- package/docs/api/functions/createRalphLoopHook.html +2 -2
- package/docs/api/functions/createRecoveryHook.html +7 -7
- package/docs/api/functions/createRulesInjectorHook.html +8 -8
- package/docs/api/functions/createSimplePrd.html +2 -2
- package/docs/api/functions/createSisyphusOrchestratorHook.html +7 -7
- package/docs/api/functions/createSisyphusSession.html +7 -7
- package/docs/api/functions/createThinkModeHook.html +7 -7
- package/docs/api/functions/createThinkingBlockValidatorHook.html +1 -1
- package/docs/api/functions/createTodoContinuationHook.html +2 -2
- package/docs/api/functions/createUltraworkStateHook.html +2 -2
- package/docs/api/functions/deactivateUltrawork.html +8 -8
- package/docs/api/functions/decayHotPaths.html +2 -2
- package/docs/api/functions/decomposeTask.html +11 -11
- package/docs/api/functions/deepMerge.html +2 -2
- package/docs/api/functions/detectArchitectApproval.html +2 -2
- package/docs/api/functions/detectArchitectRejection.html +2 -2
- package/docs/api/functions/detectContextLimitError.html +2 -2
- package/docs/api/functions/detectContextLimitErrorInText.html +2 -2
- package/docs/api/functions/detectDirectivesFromMessage.html +2 -2
- package/docs/api/functions/detectEditError.html +2 -2
- package/docs/api/functions/detectEditErrorInOutput.html +2 -2
- package/docs/api/functions/detectEditErrorInText.html +2 -2
- package/docs/api/functions/detectExtractableMoment.html +2 -2
- package/docs/api/functions/detectKeywordsWithType.html +11 -11
- package/docs/api/functions/detectMagicKeywords.html +2 -2
- package/docs/api/functions/detectProjectEnvironment.html +2 -2
- package/docs/api/functions/detectRecoverableError.html +3 -3
- package/docs/api/functions/detectSessionErrorType.html +2 -2
- package/docs/api/functions/detectSlashCommand.html +3 -3
- package/docs/api/functions/detectThinkKeyword.html +2 -2
- package/docs/api/functions/detectUltrathinkKeyword.html +2 -2
- package/docs/api/functions/discoverAllCommands.html +2 -2
- package/docs/api/functions/enablePrdMode.html +2 -2
- package/docs/api/functions/enhancePrompt.html +2 -2
- package/docs/api/functions/ensureAutopilotDir.html +2 -2
- package/docs/api/functions/ensureDirectoryStructure.html +2 -2
- package/docs/api/functions/ensureModeStateDir.html +2 -2
- package/docs/api/functions/ensureSkillsDir.html +2 -2
- package/docs/api/functions/estimateTokens.html +2 -2
- package/docs/api/functions/executeSlashCommand.html +2 -2
- package/docs/api/functions/expandCommand.html +8 -8
- package/docs/api/functions/expandCommandPrompt.html +6 -6
- package/docs/api/functions/expandCommands.html +2 -2
- package/docs/api/functions/exportSessionSummary.html +2 -2
- package/docs/api/functions/exportWisdomToNotepad.html +2 -2
- package/docs/api/functions/extractPromptText.html +11 -11
- package/docs/api/functions/extractSlashPromptText.html +2 -2
- package/docs/api/functions/extractThinkPromptText.html +2 -2
- package/docs/api/functions/failWorker.html +2 -2
- package/docs/api/functions/findCommand.html +2 -2
- package/docs/api/functions/findMatchingSkills.html +2 -2
- package/docs/api/functions/findPlannerPlans.html +3 -3
- package/docs/api/functions/findPrdPath.html +2 -2
- package/docs/api/functions/findPreviousThinkingContent.html +1 -1
- package/docs/api/functions/findProgressPath.html +2 -2
- package/docs/api/functions/findProjectRoot.html +3 -3
- package/docs/api/functions/findRecoveryEmptyMessages.html +2 -2
- package/docs/api/functions/findRecoveryOrphanThinking.html +2 -2
- package/docs/api/functions/findRecoveryThinkingBlocks.html +2 -2
- package/docs/api/functions/findRuleFiles.html +4 -4
- package/docs/api/functions/findSkillFiles.html +3 -3
- package/docs/api/functions/formatCancelMessage.html +2 -2
- package/docs/api/functions/formatCompactSummary.html +2 -2
- package/docs/api/functions/formatContextSummary.html +3 -3
- package/docs/api/functions/formatDirectivesForContext.html +2 -2
- package/docs/api/functions/formatFailureSummary.html +2 -2
- package/docs/api/functions/formatFile.html +2 -2
- package/docs/api/functions/formatFileChanges.html +2 -2
- package/docs/api/functions/formatFileList.html +2 -2
- package/docs/api/functions/formatFullContext.html +2 -2
- package/docs/api/functions/formatFullNotepad.html +2 -2
- package/docs/api/functions/formatLearningsForContext.html +2 -2
- package/docs/api/functions/formatNextStoryPrompt.html +2 -2
- package/docs/api/functions/formatNotepadContext.html +2 -2
- package/docs/api/functions/formatPatternsForContext.html +2 -2
- package/docs/api/functions/formatPrd.html +2 -2
- package/docs/api/functions/formatPrdStatus.html +2 -2
- package/docs/api/functions/formatPreCompactSummary.html +2 -2
- package/docs/api/functions/formatProgressForContext.html +2 -2
- package/docs/api/functions/formatProgressMessage.html +2 -2
- package/docs/api/functions/formatStory.html +2 -2
- package/docs/api/functions/formatSummary.html +2 -2
- package/docs/api/functions/formatUpdateNotification.html +2 -2
- package/docs/api/functions/formatValidationResults.html +2 -2
- package/docs/api/functions/generateExtractionPrompt.html +2 -2
- package/docs/api/functions/generateSkillFrontmatter.html +2 -2
- package/docs/api/functions/generateSummary.html +2 -2
- package/docs/api/functions/getActiveAgentCount.html +2 -2
- package/docs/api/functions/getActiveExclusiveMode.html +4 -4
- package/docs/api/functions/getActiveModes.html +2 -2
- package/docs/api/functions/getActivePlanPath.html +2 -2
- package/docs/api/functions/getAgentDefinitions.html +2 -2
- package/docs/api/functions/getAgentsByType.html +2 -2
- package/docs/api/functions/getAllCommands.html +2 -2
- package/docs/api/functions/getAllModeStatuses.html +5 -5
- package/docs/api/functions/getAllSkills.html +2 -2
- package/docs/api/functions/getArchitectRejectionContinuationPrompt.html +2 -2
- package/docs/api/functions/getArchitectVerificationPrompt.html +2 -2
- package/docs/api/functions/getAutoFormatMessage.html +2 -2
- package/docs/api/functions/getAutopilotStateAge.html +3 -3
- package/docs/api/functions/getAvailableAgents.html +2 -2
- package/docs/api/functions/getAxiomDir.html +1 -1
- package/docs/api/functions/getBackgroundTaskGuidance.html +4 -4
- package/docs/api/functions/getBeadsContextConfig.html +2 -2
- package/docs/api/functions/getBeadsInstructions.html +2 -2
- package/docs/api/functions/getBoulderFilePath.html +2 -2
- package/docs/api/functions/getCheckpointPath.html +2 -2
- package/docs/api/functions/getClaudeThinkingConfig.html +3 -3
- package/docs/api/functions/getCommand.html +2 -2
- package/docs/api/functions/getCommandsDir.html +2 -2
- package/docs/api/functions/getCompactionQueueDepth.html +3 -3
- package/docs/api/functions/getCompletedWorkers.html +2 -2
- package/docs/api/functions/getDefaultMcpServers.html +1 -1
- package/docs/api/functions/getDefaultModelForCategory.html +2 -2
- package/docs/api/functions/getDetectionStats.html +2 -2
- package/docs/api/functions/getDirectPlanningPrompt.html +3 -3
- package/docs/api/functions/getExecutionPrompt.html +2 -2
- package/docs/api/functions/getExpansionPrompt.html +3 -3
- package/docs/api/functions/getExpertGateMessage.html +1 -1
- package/docs/api/functions/getFailedWorkers.html +2 -2
- package/docs/api/functions/getFormatter.html +2 -2
- package/docs/api/functions/getGitDiffStats.html +2 -2
- package/docs/api/functions/getGlobalStateFilePath.html +4 -4
- package/docs/api/functions/getGoalCommand.html +2 -2
- package/docs/api/functions/getHighVariant.html +3 -3
- package/docs/api/functions/getInstallInfo.html +2 -2
- package/docs/api/functions/getInstalledVersion.html +2 -2
- package/docs/api/functions/getIssuesToFix.html +2 -2
- package/docs/api/functions/getLastDetection.html +2 -2
- package/docs/api/functions/getLearnerConfigValue.html +2 -2
- package/docs/api/functions/getLinter.html +2 -2
- package/docs/api/functions/getManualSection.html +2 -2
- package/docs/api/functions/getMemoryFilePaths.html +1 -1
- package/docs/api/functions/getModeMarkerFilePath.html +2 -2
- package/docs/api/functions/getModeStateFilePath.html +2 -2
- package/docs/api/functions/getNextStory.html +2 -2
- package/docs/api/functions/getNotepadPath.html +2 -2
- package/docs/api/functions/getNotepadStats.html +2 -2
- package/docs/api/functions/getOmcPrdPath.html +2 -2
- package/docs/api/functions/getOmcProgressPath.html +2 -2
- package/docs/api/functions/getOmcSystemPrompt.html +2 -2
- package/docs/api/functions/getOmcToolNames.html +3 -3
- package/docs/api/functions/getPatterns.html +2 -2
- package/docs/api/functions/getPhasePrompt.html +2 -2
- package/docs/api/functions/getPlanName.html +2 -2
- package/docs/api/functions/getPlanPath.html +2 -2
- package/docs/api/functions/getPlanProgress.html +2 -2
- package/docs/api/functions/getPlanSummaries.html +2 -2
- package/docs/api/functions/getPrdCompletionStatus.html +2 -2
- package/docs/api/functions/getPrdPath.html +2 -2
- package/docs/api/functions/getPrdStatus.html +2 -2
- package/docs/api/functions/getPreCommitReminderMessage.html +2 -2
- package/docs/api/functions/getPriorityContext.html +2 -2
- package/docs/api/functions/getProgressContext.html +2 -2
- package/docs/api/functions/getProgressPath.html +2 -2
- package/docs/api/functions/getPromotionCandidates.html +2 -2
- package/docs/api/functions/getQAPrompt.html +2 -2
- package/docs/api/functions/getRalphContext.html +3 -3
- package/docs/api/functions/getReadmesForPath.html +2 -2
- package/docs/api/functions/getRecentLearnings.html +2 -2
- package/docs/api/functions/getRulesForPath.html +2 -2
- package/docs/api/functions/getRunningAgents.html +2 -2
- package/docs/api/functions/getRunningWorkers.html +2 -2
- package/docs/api/functions/getSessionTokenEstimate.html +2 -2
- package/docs/api/functions/getSkillsDir.html +2 -2
- package/docs/api/functions/getSpecPath.html +2 -2
- package/docs/api/functions/getStaleAgents.html +2 -2
- package/docs/api/functions/getStateDir.html +2 -2
- package/docs/api/functions/getStory.html +2 -2
- package/docs/api/functions/getSubagentStateFilePath.html +2 -2
- package/docs/api/functions/getThinkModeState.html +2 -2
- package/docs/api/functions/getThinkingConfig.html +3 -3
- package/docs/api/functions/getTopHotPaths.html +2 -2
- package/docs/api/functions/getTrackingStats.html +2 -2
- package/docs/api/functions/getTransitionPrompt.html +2 -2
- package/docs/api/functions/getUltraworkPersistenceMessage.html +2 -2
- package/docs/api/functions/getValidationPrompt.html +2 -2
- package/docs/api/functions/getValidationSpawnPrompt.html +2 -2
- package/docs/api/functions/getValidationStats.html +1 -1
- package/docs/api/functions/getValidationStatus.html +2 -2
- package/docs/api/functions/getWorkingMemory.html +2 -2
- package/docs/api/functions/handleBackgroundEvent.html +3 -3
- package/docs/api/functions/handleContextWindowRecovery.html +2 -2
- package/docs/api/functions/handleEditErrorRecovery.html +2 -2
- package/docs/api/functions/handlePermissionRequest.html +2 -2
- package/docs/api/functions/handleRecovery.html +10 -10
- package/docs/api/functions/handleSessionEnd.html +2 -2
- package/docs/api/functions/handleSessionRecovery.html +2 -2
- package/docs/api/functions/handleSharedFiles.html +7 -7
- package/docs/api/functions/handleSubagentStart.html +2 -2
- package/docs/api/functions/handleSubagentStop.html +2 -2
- package/docs/api/functions/hasBoulder.html +2 -2
- package/docs/api/functions/hasContentParts.html +1 -1
- package/docs/api/functions/hasModeState.html +3 -3
- package/docs/api/functions/hasPrd.html +2 -2
- package/docs/api/functions/hasTextContent.html +2 -2
- package/docs/api/functions/hasValidContent.html +3 -3
- package/docs/api/functions/incrementAgentCount.html +2 -2
- package/docs/api/functions/incrementRalphIteration.html +2 -2
- package/docs/api/functions/incrementReinforcement.html +2 -2
- package/docs/api/functions/initAutopilot.html +2 -2
- package/docs/api/functions/initNotepad.html +2 -2
- package/docs/api/functions/initPrd.html +2 -2
- package/docs/api/functions/initProgress.html +2 -2
- package/docs/api/functions/initUltrapilot.html +2 -2
- package/docs/api/functions/injectContextIntoText.html +2 -2
- package/docs/api/functions/injectPendingContext.html +3 -3
- package/docs/api/functions/injectRecoveryTextPart.html +2 -2
- package/docs/api/functions/install.html +2 -2
- package/docs/api/functions/integrateResults.html +5 -5
- package/docs/api/functions/isActiveModeRunning.html +2 -2
- package/docs/api/functions/isAllowedPath.html +2 -2
- package/docs/api/functions/isAlreadyHighVariant.html +2 -2
- package/docs/api/functions/isAutopilotActive.html +2 -2
- package/docs/api/functions/isAxiomEnabled.html +1 -1
- package/docs/api/functions/isClaudeInstalled.html +3 -3
- package/docs/api/functions/isClaudeModel.html +2 -2
- package/docs/api/functions/isCompactionInProgress.html +3 -3
- package/docs/api/functions/isDuplicateByContentHash.html +2 -2
- package/docs/api/functions/isDuplicateByRealPath.html +2 -2
- package/docs/api/functions/isExcludedCommand.html +2 -2
- package/docs/api/functions/isExtendedThinkingModel.html +1 -1
- package/docs/api/functions/isFileOwnedByWorker.html +2 -2
- package/docs/api/functions/isFormatterAvailable.html +2 -2
- package/docs/api/functions/isGptModel.html +2 -2
- package/docs/api/functions/isInstalled.html +2 -2
- package/docs/api/functions/isLearnerEnabled.html +2 -2
- package/docs/api/functions/isModeActive.html +6 -6
- package/docs/api/functions/isNonInteractive.html +1 -1
- package/docs/api/functions/isRecoverableError.html +2 -2
- package/docs/api/functions/isSafeCommand.html +2 -2
- package/docs/api/functions/isSessionRecoverable.html +2 -2
- package/docs/api/functions/isSharedFile.html +2 -2
- package/docs/api/functions/isThinkModeActive.html +2 -2
- package/docs/api/functions/isToolPart.html +2 -2
- package/docs/api/functions/isUltraQAActive.html +1 -1
- package/docs/api/functions/isWriteEditTool.html +2 -2
- package/docs/api/functions/learnFromToolOutput.html +7 -7
- package/docs/api/functions/lintFile.html +2 -2
- package/docs/api/functions/listAvailableCommands.html +2 -2
- package/docs/api/functions/listCommands.html +2 -2
- package/docs/api/functions/listPromotableLearnings.html +2 -2
- package/docs/api/functions/loadAgentPrompt.html +7 -7
- package/docs/api/functions/loadAgentUsageState.html +1 -1
- package/docs/api/functions/loadAllSkills.html +3 -3
- package/docs/api/functions/loadConfig.html +2 -2
- package/docs/api/functions/loadInjectedPaths.html +2 -2
- package/docs/api/functions/loadInjectedRules.html +2 -2
- package/docs/api/functions/loadLearnerConfig.html +2 -2
- package/docs/api/functions/loadProjectMemory.html +3 -3
- package/docs/api/functions/loadSkillById.html +2 -2
- package/docs/api/functions/mapDirectoryStructure.html +2 -2
- package/docs/api/functions/markStoryComplete.html +2 -2
- package/docs/api/functions/markStoryIncomplete.html +2 -2
- package/docs/api/functions/mergeAgentConfig.html +2 -2
- package/docs/api/functions/parseAxiomState.html +1 -1
- package/docs/api/functions/parseContextLimitError.html +2 -2
- package/docs/api/functions/parseProgress.html +2 -2
- package/docs/api/functions/parseRuleFrontmatter.html +10 -10
- package/docs/api/functions/parseSkillFile.html +2 -2
- package/docs/api/functions/parseSlashCommand.html +2 -2
- package/docs/api/functions/parseTokenLimitError.html +2 -2
- package/docs/api/functions/performUpdate.html +2 -2
- package/docs/api/functions/prependRecoveryThinkingPart.html +2 -2
- package/docs/api/functions/prependThinkingBlock.html +1 -1
- package/docs/api/functions/processAxiomBoot.html +1 -1
- package/docs/api/functions/processAxiomGuards.html +1 -1
- package/docs/api/functions/processBackgroundNotification.html +2 -2
- package/docs/api/functions/processBackgroundNotificationHook.html +2 -2
- package/docs/api/functions/processEditOutput.html +2 -2
- package/docs/api/functions/processHook.html +3 -3
- package/docs/api/functions/processMessageForSkills.html +2 -2
- package/docs/api/functions/processOrchestratorPostTool.html +3 -3
- package/docs/api/functions/processOrchestratorPreTool.html +3 -3
- package/docs/api/functions/processPermissionRequest.html +2 -2
- package/docs/api/functions/processPreCompact.html +6 -6
- package/docs/api/functions/processProjectMemoryPreCompact.html +3 -3
- package/docs/api/functions/processResponseForDetection.html +3 -3
- package/docs/api/functions/processSessionEnd.html +2 -2
- package/docs/api/functions/processSetup.html +2 -2
- package/docs/api/functions/processSetupInit.html +2 -2
- package/docs/api/functions/processSetupMaintenance.html +2 -2
- package/docs/api/functions/processSlashCommand.html +2 -2
- package/docs/api/functions/processSubagentStart.html +2 -2
- package/docs/api/functions/processSubagentStop.html +2 -2
- package/docs/api/functions/processThinkMode.html +3 -3
- package/docs/api/functions/promoteLearning.html +2 -2
- package/docs/api/functions/pruneOldEntries.html +2 -2
- package/docs/api/functions/pruneOldStateFiles.html +2 -2
- package/docs/api/functions/readActiveContext.html +1 -1
- package/docs/api/functions/readAutopilotState.html +2 -2
- package/docs/api/functions/readBoulderState.html +2 -2
- package/docs/api/functions/readModeMarker.html +4 -4
- package/docs/api/functions/readNotepad.html +2 -2
- package/docs/api/functions/readPrd.html +2 -2
- package/docs/api/functions/readProgress.html +2 -2
- package/docs/api/functions/readProgressRaw.html +2 -2
- package/docs/api/functions/readProjectDecisions.html +1 -1
- package/docs/api/functions/readRalphState.html +2 -2
- package/docs/api/functions/readRecoveryMessages.html +2 -2
- package/docs/api/functions/readRecoveryParts.html +2 -2
- package/docs/api/functions/readTrackingState.html +3 -3
- package/docs/api/functions/readUltraQAState.html +2 -2
- package/docs/api/functions/readUltrapilotState.html +2 -2
- package/docs/api/functions/readUltraworkState.html +4 -4
- package/docs/api/functions/readUserPreferences.html +1 -1
- package/docs/api/functions/readVerificationState.html +3 -3
- package/docs/api/functions/recordArchitectFeedback.html +2 -2
- package/docs/api/functions/recordConflict.html +2 -2
- package/docs/api/functions/recordFailure.html +2 -2
- package/docs/api/functions/recordHookFire.html +2 -2
- package/docs/api/functions/recordHookResult.html +2 -2
- package/docs/api/functions/recordKeywordDetected.html +2 -2
- package/docs/api/functions/recordModeChange.html +2 -2
- package/docs/api/functions/recordPattern.html +2 -2
- package/docs/api/functions/recordSessionMetrics.html +2 -2
- package/docs/api/functions/recordSkillActivated.html +2 -2
- package/docs/api/functions/recordSkillInvoked.html +2 -2
- package/docs/api/functions/recordStoryProgress.html +2 -2
- package/docs/api/functions/recordValidationVerdict.html +2 -2
- package/docs/api/functions/registerBeadsContext.html +3 -3
- package/docs/api/functions/registerProjectMemoryContext.html +6 -6
- package/docs/api/functions/removeCodeBlocks.html +12 -12
- package/docs/api/functions/removeModeMarker.html +5 -5
- package/docs/api/functions/removeSlashCodeBlocks.html +2 -2
- package/docs/api/functions/removeThinkCodeBlocks.html +2 -2
- package/docs/api/functions/replaceRecoveryEmptyTextParts.html +2 -2
- package/docs/api/functions/rescanProjectEnvironment.html +4 -4
- package/docs/api/functions/resetSessionTokenEstimate.html +2 -2
- package/docs/api/functions/resumeAutopilot.html +2 -2
- package/docs/api/functions/runPreCommitChecks.html +2 -2
- package/docs/api/functions/runTests.html +2 -2
- package/docs/api/functions/runTypeCheck.html +2 -2
- package/docs/api/functions/sanitizeMessage.html +2 -2
- package/docs/api/functions/sanitizeMessages.html +2 -2
- package/docs/api/functions/saveAgentUsageState.html +1 -1
- package/docs/api/functions/saveInjectedPaths.html +2 -2
- package/docs/api/functions/saveInjectedRules.html +2 -2
- package/docs/api/functions/saveLearnerConfig.html +2 -2
- package/docs/api/functions/saveModeSummary.html +2 -2
- package/docs/api/functions/saveProjectMemory.html +3 -3
- package/docs/api/functions/saveVersionMetadata.html +2 -2
- package/docs/api/functions/setCurrentStory.html +2 -2
- package/docs/api/functions/setEnvironmentVariables.html +2 -2
- package/docs/api/functions/setLearnerConfigValue.html +2 -2
- package/docs/api/functions/setPriorityContext.html +2 -2
- package/docs/api/functions/shouldActivateThinkMode.html +3 -3
- package/docs/api/functions/shouldActivateUltrathink.html +2 -2
- package/docs/api/functions/shouldApplyRule.html +2 -2
- package/docs/api/functions/shouldCheckForUpdates.html +2 -2
- package/docs/api/functions/shouldCompleteByPrd.html +2 -2
- package/docs/api/functions/shouldPromptExtraction.html +2 -2
- package/docs/api/functions/shouldReinforceUltrawork.html +2 -2
- package/docs/api/functions/shouldRetryValidation.html +2 -2
- package/docs/api/functions/shouldRunInBackground.html +8 -8
- package/docs/api/functions/spawnWorkers.html +7 -7
- package/docs/api/functions/startUltraQA.html +3 -3
- package/docs/api/functions/startUltrapilot.html +7 -7
- package/docs/api/functions/startValidationRound.html +2 -2
- package/docs/api/functions/startVerification.html +2 -2
- package/docs/api/functions/startsWithThinkingBlock.html +1 -1
- package/docs/api/functions/stopUltraQA.html +2 -2
- package/docs/api/functions/stripRecoveryThinkingParts.html +2 -2
- package/docs/api/functions/toSdkMcpFormat.html +2 -2
- package/docs/api/functions/trackAccess.html +2 -2
- package/docs/api/functions/trackProgress.html +5 -5
- package/docs/api/functions/transitionPhase.html +2 -2
- package/docs/api/functions/transitionRalphToUltraQA.html +9 -9
- package/docs/api/functions/transitionToComplete.html +2 -2
- package/docs/api/functions/transitionToFailed.html +2 -2
- package/docs/api/functions/transitionUltraQAToValidation.html +2 -2
- package/docs/api/functions/updateDirectoryAccess.html +2 -2
- package/docs/api/functions/updateExecution.html +2 -2
- package/docs/api/functions/updateExpansion.html +2 -2
- package/docs/api/functions/updatePlanning.html +2 -2
- package/docs/api/functions/updateQA.html +2 -2
- package/docs/api/functions/updateValidation.html +2 -2
- package/docs/api/functions/updateWorkerState.html +2 -2
- package/docs/api/functions/validateAgentConfig.html +2 -2
- package/docs/api/functions/validateCommitMessage.html +2 -2
- package/docs/api/functions/validateConfigFiles.html +2 -2
- package/docs/api/functions/validateExtractionRequest.html +2 -2
- package/docs/api/functions/validateMessage.html +1 -1
- package/docs/api/functions/validateMessages.html +1 -1
- package/docs/api/functions/validateSkillMetadata.html +2 -2
- package/docs/api/functions/writeAutopilotState.html +2 -2
- package/docs/api/functions/writeBoulderState.html +2 -2
- package/docs/api/functions/writePrd.html +2 -2
- package/docs/api/functions/writeRalphState.html +2 -2
- package/docs/api/functions/writeSkill.html +2 -2
- package/docs/api/functions/writeTrackingState.html +5 -5
- package/docs/api/functions/writeUltraQAState.html +2 -2
- package/docs/api/functions/writeUltrapilotState.html +2 -2
- package/docs/api/functions/writeUltraworkState.html +2 -2
- package/docs/api/functions/writeVerificationState.html +2 -2
- package/docs/api/hierarchy.html +1 -1
- package/docs/api/index.html +843 -843
- package/docs/api/interfaces/AgentConfig.html +18 -18
- package/docs/api/interfaces/AgentOverrideConfig.html +10 -10
- package/docs/api/interfaces/AgentPromptMetadata.html +19 -19
- package/docs/api/interfaces/AgentState.html +5 -5
- package/docs/api/interfaces/AgentUsageState.html +8 -8
- package/docs/api/interfaces/AutoSlashCommandHookInput.html +5 -5
- package/docs/api/interfaces/AutoSlashCommandHookOutput.html +3 -3
- package/docs/api/interfaces/AutoSlashCommandResult.html +5 -5
- package/docs/api/interfaces/AutopilotConfig.html +26 -26
- package/docs/api/interfaces/AutopilotExecution.html +16 -16
- package/docs/api/interfaces/AutopilotExpansion.html +12 -12
- package/docs/api/interfaces/AutopilotPlanning.html +8 -8
- package/docs/api/interfaces/AutopilotQA.html +12 -12
- package/docs/api/interfaces/AutopilotResult.html +10 -10
- package/docs/api/interfaces/AutopilotState.html +36 -36
- package/docs/api/interfaces/AutopilotSummary.html +16 -16
- package/docs/api/interfaces/AutopilotValidation.html +10 -10
- package/docs/api/interfaces/AutopilotValidationResult.html +8 -8
- package/docs/api/interfaces/AvailableAgent.html +5 -5
- package/docs/api/interfaces/AxiomBootInput.html +3 -3
- package/docs/api/interfaces/AxiomBootOutput.html +4 -4
- package/docs/api/interfaces/AxiomGuardsInput.html +4 -4
- package/docs/api/interfaces/AxiomGuardsOutput.html +4 -4
- package/docs/api/interfaces/AxiomMemoryFiles.html +5 -5
- package/docs/api/interfaces/AxiomState.html +8 -8
- package/docs/api/interfaces/BackgroundNotificationHookConfig.html +11 -11
- package/docs/api/interfaces/BackgroundNotificationHookInput.html +8 -8
- package/docs/api/interfaces/BackgroundNotificationHookOutput.html +8 -8
- package/docs/api/interfaces/BackgroundTask.html +7 -7
- package/docs/api/interfaces/BackgroundTaskManager.html +26 -26
- package/docs/api/interfaces/BeadsContextConfig.html +4 -4
- package/docs/api/interfaces/BoulderState.html +12 -12
- package/docs/api/interfaces/BuildInfo.html +6 -6
- package/docs/api/interfaces/CanStartResult.html +4 -4
- package/docs/api/interfaces/CancelResult.html +4 -4
- package/docs/api/interfaces/ClaudeThinkingConfig.html +4 -4
- package/docs/api/interfaces/CodeConventions.html +5 -5
- package/docs/api/interfaces/CodebasePattern.html +5 -5
- package/docs/api/interfaces/CommandInfo.html +5 -5
- package/docs/api/interfaces/CommandMetadata.html +7 -7
- package/docs/api/interfaces/CommentCheckResult.html +10 -10
- package/docs/api/interfaces/CommentCheckerConfig.html +6 -6
- package/docs/api/interfaces/CommentInfo.html +14 -14
- package/docs/api/interfaces/CommentPendingCall.html +18 -18
- package/docs/api/interfaces/CommitConfig.html +9 -9
- package/docs/api/interfaces/CompactCheckpoint.html +7 -7
- package/docs/api/interfaces/ContextEntry.html +14 -14
- package/docs/api/interfaces/ContextUsageResult.html +12 -12
- package/docs/api/interfaces/CustomNote.html +5 -5
- package/docs/api/interfaces/DelegationDecision.html +7 -7
- package/docs/api/interfaces/DelegationRoute.html +7 -7
- package/docs/api/interfaces/DelegationRoutingConfig.html +5 -5
- package/docs/api/interfaces/DelegationTrigger.html +6 -6
- package/docs/api/interfaces/DetectedKeyword.html +13 -13
- package/docs/api/interfaces/DetectionConfig.html +8 -8
- package/docs/api/interfaces/DetectionResult.html +13 -13
- package/docs/api/interfaces/DirectoryInfo.html +7 -7
- package/docs/api/interfaces/EmptyMessageSanitizerConfig.html +6 -6
- package/docs/api/interfaces/EmptyMessageSanitizerInput.html +6 -6
- package/docs/api/interfaces/EmptyMessageSanitizerOutput.html +8 -8
- package/docs/api/interfaces/ExecuteResult.html +5 -5
- package/docs/api/interfaces/ExpandedCommand.html +4 -4
- package/docs/api/interfaces/ExternalModelPreference.html +4 -4
- package/docs/api/interfaces/ExternalModelsConfig.html +6 -6
- package/docs/api/interfaces/ExternalModelsDefaults.html +5 -5
- package/docs/api/interfaces/ExternalModelsFallbackPolicy.html +5 -5
- package/docs/api/interfaces/FileOwnership.html +8 -8
- package/docs/api/interfaces/FormatConfig.html +7 -7
- package/docs/api/interfaces/FrameworkDetection.html +4 -4
- package/docs/api/interfaces/FullAgentConfig.html +26 -26
- package/docs/api/interfaces/GateCheckResult.html +5 -5
- package/docs/api/interfaces/GitBranchPattern.html +3 -3
- package/docs/api/interfaces/HookContext.html +5 -5
- package/docs/api/interfaces/HookDefinition.html +5 -5
- package/docs/api/interfaces/HookInput.html +18 -18
- package/docs/api/interfaces/HookOutput.html +10 -10
- package/docs/api/interfaces/HookResult.html +4 -4
- package/docs/api/interfaces/HotPath.html +6 -6
- package/docs/api/interfaces/InjectedPathsData.html +9 -9
- package/docs/api/interfaces/InjectedRulesData.html +10 -10
- package/docs/api/interfaces/InjectedSkillsData.html +8 -8
- package/docs/api/interfaces/InjectionResult.html +8 -8
- package/docs/api/interfaces/InstallOptions.html +9 -9
- package/docs/api/interfaces/InstallResult.html +10 -10
- package/docs/api/interfaces/IntegrationResult.html +14 -14
- package/docs/api/interfaces/LanguageDetection.html +5 -5
- package/docs/api/interfaces/LearnedSkill.html +16 -16
- package/docs/api/interfaces/LearnerConfig.html +18 -18
- package/docs/api/interfaces/LintConfig.html +7 -7
- package/docs/api/interfaces/MagicKeyword.html +4 -4
- package/docs/api/interfaces/MatchResult.html +6 -6
- package/docs/api/interfaces/MessageContext.html +8 -8
- package/docs/api/interfaces/MessageInfo.html +9 -9
- package/docs/api/interfaces/MessagePart.html +15 -15
- package/docs/api/interfaces/MessageWithModel.html +3 -3
- package/docs/api/interfaces/MessageWithParts.html +6 -6
- package/docs/api/interfaces/MessagesTransformHook.html +3 -3
- package/docs/api/interfaces/MessagesTransformInput.html +3 -3
- package/docs/api/interfaces/MessagesTransformOutput.html +3 -3
- package/docs/api/interfaces/ModeConfig.html +13 -13
- package/docs/api/interfaces/ModeStatus.html +4 -4
- package/docs/api/interfaces/ModelRef.html +4 -4
- package/docs/api/interfaces/NonInteractiveEnvConfig.html +2 -2
- package/docs/api/interfaces/NotepadConfig.html +7 -7
- package/docs/api/interfaces/NotepadStats.html +11 -11
- package/docs/api/interfaces/NotificationCheckResult.html +8 -8
- package/docs/api/interfaces/OrchestratorToolInput.html +6 -6
- package/docs/api/interfaces/OrchestratorToolOutput.html +6 -6
- package/docs/api/interfaces/OutputPart.html +4 -4
- package/docs/api/interfaces/PRD.html +9 -9
- package/docs/api/interfaces/PRDStatus.html +13 -13
- package/docs/api/interfaces/ParsedSlashCommand.html +8 -8
- package/docs/api/interfaces/ParsedTokenLimitError.html +16 -16
- package/docs/api/interfaces/PendingContext.html +8 -8
- package/docs/api/interfaces/PermissionHookOutput.html +4 -4
- package/docs/api/interfaces/PermissionRequestInput.html +9 -9
- package/docs/api/interfaces/PersistentModeResult.html +9 -9
- package/docs/api/interfaces/PlanProgress.html +8 -8
- package/docs/api/interfaces/PlanSummary.html +10 -10
- package/docs/api/interfaces/PluginConfig.html +17 -17
- package/docs/api/interfaces/PreCommitResult.html +3 -3
- package/docs/api/interfaces/PreCompactHookOutput.html +4 -4
- package/docs/api/interfaces/PreCompactInput.html +8 -8
- package/docs/api/interfaces/PreemptiveCompactionConfig.html +14 -14
- package/docs/api/interfaces/PriorityContextResult.html +5 -5
- package/docs/api/interfaces/ProgressEntry.html +11 -11
- package/docs/api/interfaces/ProgressLog.html +7 -7
- package/docs/api/interfaces/ProjectMemory.html +14 -14
- package/docs/api/interfaces/ProjectStructure.html +5 -5
- package/docs/api/interfaces/PromotionCandidate.html +9 -9
- package/docs/api/interfaces/PruneResult.html +5 -5
- package/docs/api/interfaces/QualityValidation.html +10 -10
- package/docs/api/interfaces/RalphLoopHook.html +4 -4
- package/docs/api/interfaces/RalphLoopOptions.html +5 -5
- package/docs/api/interfaces/RalphLoopState.html +21 -21
- package/docs/api/interfaces/RecoveryConfig.html +16 -16
- package/docs/api/interfaces/RecoveryMessageData.html +4 -4
- package/docs/api/interfaces/RecoveryResult.html +10 -10
- package/docs/api/interfaces/RecoveryStoredMessageMeta.html +8 -8
- package/docs/api/interfaces/RecoveryStoredReasoningPart.html +7 -7
- package/docs/api/interfaces/RecoveryStoredTextPart.html +9 -9
- package/docs/api/interfaces/RecoveryStoredToolPart.html +9 -9
- package/docs/api/interfaces/RegisterContextOptions.html +12 -12
- package/docs/api/interfaces/ReleaseInfo.html +9 -9
- package/docs/api/interfaces/ResolveDelegationOptions.html +7 -7
- package/docs/api/interfaces/ResolveOptions.html +6 -6
- package/docs/api/interfaces/ResolvedModel.html +5 -5
- package/docs/api/interfaces/RetryState.html +6 -6
- package/docs/api/interfaces/RuleFileCandidate.html +12 -12
- package/docs/api/interfaces/RuleFrontmatterResult.html +6 -6
- package/docs/api/interfaces/RuleInfo.html +18 -18
- package/docs/api/interfaces/RuleMetadata.html +9 -9
- package/docs/api/interfaces/RuleToInject.html +10 -10
- package/docs/api/interfaces/SessionEndHookOutput.html +2 -2
- package/docs/api/interfaces/SessionEndInput.html +9 -9
- package/docs/api/interfaces/SessionMetrics.html +9 -9
- package/docs/api/interfaces/SessionState.html +5 -5
- package/docs/api/interfaces/SetupHookOutput.html +3 -3
- package/docs/api/interfaces/SetupInput.html +7 -7
- package/docs/api/interfaces/SetupResult.html +5 -5
- package/docs/api/interfaces/ShellHook.html +4 -4
- package/docs/api/interfaces/SisyphusOptions.html +14 -14
- package/docs/api/interfaces/SisyphusSession.html +16 -16
- package/docs/api/interfaces/SkillExtractionRequest.html +12 -12
- package/docs/api/interfaces/SkillFileCandidate.html +10 -10
- package/docs/api/interfaces/SkillHookContext.html +5 -5
- package/docs/api/interfaces/SkillMetadata.html +22 -22
- package/docs/api/interfaces/SkillParseResult.html +5 -5
- package/docs/api/interfaces/SubagentHookOutput.html +3 -3
- package/docs/api/interfaces/SubagentInfo.html +14 -14
- package/docs/api/interfaces/SubagentStartInput.html +10 -10
- package/docs/api/interfaces/SubagentStopInput.html +11 -11
- package/docs/api/interfaces/SubagentTrackingState.html +6 -6
- package/docs/api/interfaces/TaskExecutionDecision.html +10 -10
- package/docs/api/interfaces/TechStack.html +5 -5
- package/docs/api/interfaces/ThinkModeInput.html +4 -4
- package/docs/api/interfaces/ThinkModeState.html +12 -12
- package/docs/api/interfaces/ThinkingValidatorMessageInfo.html +6 -6
- package/docs/api/interfaces/ThinkingValidatorMessagePart.html +9 -9
- package/docs/api/interfaces/ThinkingValidatorMessageWithParts.html +4 -4
- package/docs/api/interfaces/TodoContinuationHook.html +2 -2
- package/docs/api/interfaces/TransitionResult.html +4 -4
- package/docs/api/interfaces/TruncateState.html +6 -6
- package/docs/api/interfaces/UltraQAOptions.html +5 -5
- package/docs/api/interfaces/UltraQAResult.html +9 -9
- package/docs/api/interfaces/UltraQAState.html +19 -19
- package/docs/api/interfaces/UltrapilotConfig.html +14 -14
- package/docs/api/interfaces/UltrapilotState.html +26 -26
- package/docs/api/interfaces/UltraworkState.html +17 -17
- package/docs/api/interfaces/UpdateCheckResult.html +7 -7
- package/docs/api/interfaces/UpdateResult.html +7 -7
- package/docs/api/interfaces/UserDirective.html +7 -7
- package/docs/api/interfaces/UserStory.html +15 -15
- package/docs/api/interfaces/ValidationCoordinatorResult.html +6 -6
- package/docs/api/interfaces/ValidationResult.html +10 -10
- package/docs/api/interfaces/VerificationState.html +17 -17
- package/docs/api/interfaces/VersionMetadata.html +12 -12
- package/docs/api/interfaces/WorkerState.html +24 -24
- package/docs/api/interfaces/WriteSkillResult.html +6 -6
- package/docs/api/media/EVOLUTION.md +132 -62
- package/docs/api/media/INSTALL.md +105 -35
- package/docs/api/media/MIGRATION.md +340 -168
- package/docs/api/media/NEXUS.md +79 -43
- package/docs/api/media/REFERENCE.md +182 -104
- package/docs/api/media/mcp-server-usage.md +24 -11
- package/docs/api/modules.html +1 -1
- package/docs/api/types/AgentCategory.html +2 -2
- package/docs/api/types/AgentCost.html +3 -3
- package/docs/api/types/AgentFactory.html +2 -2
- package/docs/api/types/AgentOverrides.html +2 -2
- package/docs/api/types/AutopilotPhase.html +2 -2
- package/docs/api/types/AutopilotSignal.html +2 -2
- package/docs/api/types/CommandScope.html +2 -2
- package/docs/api/types/ContextPriority.html +3 -3
- package/docs/api/types/ContextSourceType.html +3 -3
- package/docs/api/types/DelegationProvider.html +2 -2
- package/docs/api/types/DelegationTool.html +2 -2
- package/docs/api/types/ExecutionMode.html +3 -3
- package/docs/api/types/ExternalModelProvider.html +2 -2
- package/docs/api/types/GateType.html +3 -3
- package/docs/api/types/InjectionStrategy.html +2 -2
- package/docs/api/types/KeywordType.html +10 -10
- package/docs/api/types/ModelType.html +2 -2
- package/docs/api/types/QAStatus.html +2 -2
- package/docs/api/types/RecoveryErrorType.html +2 -2
- package/docs/api/types/RecoveryStoredPart.html +2 -2
- package/docs/api/types/TaskTool.html +1 -1
- package/docs/api/types/ThinkingConfig.html +2 -2
- package/docs/api/types/UltraQAGoalType.html +1 -1
- package/docs/api/types/UserStoryInput.html +2 -2
- package/docs/api/types/ValidationVerdict.html +2 -2
- package/docs/api/types/ValidationVerdictType.html +2 -2
- package/docs/api/variables/AGENTS_DIR.html +1 -1
- package/docs/api/variables/AGENTS_FILENAME.html +2 -2
- package/docs/api/variables/AGENT_TOOLS.html +2 -2
- package/docs/api/variables/ALLOWED_PATH_PREFIX.html +2 -2
- package/docs/api/variables/ANALYST_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/ARCHITECT_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/AUTO_SLASH_COMMAND_HOOK_NAME.html +4 -4
- package/docs/api/variables/AUTO_SLASH_COMMAND_TAG_CLOSE.html +1 -1
- package/docs/api/variables/AUTO_SLASH_COMMAND_TAG_OPEN.html +2 -2
- package/docs/api/variables/BACKGROUND_NOTIFICATION_HOOK_NAME.html +2 -2
- package/docs/api/variables/BDD_KEYWORDS.html +2 -2
- package/docs/api/variables/BEADS_INSTRUCTIONS.html +1 -1
- package/docs/api/variables/BEADS_RUST_INSTRUCTIONS.html +1 -1
- package/docs/api/variables/BLOCKING_PATTERNS.html +3 -3
- package/docs/api/variables/BOULDER_CONTINUATION_PROMPT.html +2 -2
- package/docs/api/variables/BOULDER_DIR.html +2 -2
- package/docs/api/variables/BOULDER_FILE.html +2 -2
- package/docs/api/variables/BOULDER_STATE_PATH.html +2 -2
- package/docs/api/variables/CHARS_PER_TOKEN.html +2 -2
- package/docs/api/variables/CI_COMMANDS.html +2 -2
- package/docs/api/variables/CI_GATE_MESSAGE.html +1 -1
- package/docs/api/variables/CLAUDE_CONFIG_DIR.html +2 -2
- package/docs/api/variables/CLAUDE_DEFAULT_CONTEXT_LIMIT.html +2 -2
- package/docs/api/variables/COMMANDS_DIR.html +1 -1
- package/docs/api/variables/COMMENT_CHECKER_MESSAGE_HEADER.html +2 -2
- package/docs/api/variables/COMPACTION_COOLDOWN_MS.html +2 -2
- package/docs/api/variables/CONTENT_PART_TYPES.html +2 -2
- package/docs/api/variables/CONTEXT_CRITICAL_MESSAGE.html +2 -2
- package/docs/api/variables/CONTEXT_FILENAMES.html +2 -2
- package/docs/api/variables/CONTEXT_LIMIT_RECOVERY_MESSAGE.html +2 -2
- package/docs/api/variables/CONTEXT_LIMIT_SHORT_MESSAGE.html +2 -2
- package/docs/api/variables/CONTEXT_WARNING_MESSAGE.html +2 -2
- package/docs/api/variables/CRITICAL_THRESHOLD.html +2 -2
- package/docs/api/variables/CRITIC_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/DEFAULT_CONFIG.html +2 -2
- package/docs/api/variables/DEFAULT_MAX_BACKGROUND_TASKS.html +2 -2
- package/docs/api/variables/DEFAULT_THINKING_CONTENT.html +2 -2
- package/docs/api/variables/DIRECT_WORK_REMINDER.html +2 -2
- package/docs/api/variables/DOCUMENT_SPECIALIST_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/DOCUMENT_WRITER_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/EDIT_ERROR_PATTERNS.html +2 -2
- package/docs/api/variables/EDIT_ERROR_REMINDER.html +3 -3
- package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_DEBUG_PREFIX.html +2 -2
- package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_ERROR_PATTERNS.html +2 -2
- package/docs/api/variables/EMPTY_MESSAGE_SANITIZER_HOOK_NAME.html +2 -2
- package/docs/api/variables/ENTRY_SEPARATOR.html +1 -1
- package/docs/api/variables/EXCLUDED_COMMANDS.html +3 -3
- package/docs/api/variables/EXPERT_GATE_MESSAGE.html +1 -1
- package/docs/api/variables/EXPLORE_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/EXTENSION_TO_LANGUAGE.html +2 -2
- package/docs/api/variables/FEATURE_FLAG_KEY.html +2 -2
- package/docs/api/variables/FRONTEND_ENGINEER_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/GITHUB_API_URL.html +1 -1
- package/docs/api/variables/INSTALLER_CLAUDE_CONFIG_DIR.html +2 -2
- package/docs/api/variables/INSTALLER_VERSION.html +2 -2
- package/docs/api/variables/LINE_COMMENT_PATTERNS.html +2 -2
- package/docs/api/variables/LONG_RUNNING_PATTERNS.html +3 -3
- package/docs/api/variables/MANUAL_HEADER.html +1 -1
- package/docs/api/variables/MAX_SKILLS_PER_SESSION.html +2 -2
- package/docs/api/variables/MAX_SKILL_CONTENT_LENGTH.html +2 -2
- package/docs/api/variables/MAX_WARNINGS.html +2 -2
- package/docs/api/variables/MIN_QUALITY_SCORE.html +2 -2
- package/docs/api/variables/MODE_CONFIGS.html +4 -4
- package/docs/api/variables/MULTIMODAL_LOOKER_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/NON_EMPTY_CONTENT_RECOVERY_MESSAGE.html +2 -2
- package/docs/api/variables/NON_INTERACTIVE_ENV.html +1 -1
- package/docs/api/variables/NON_INTERACTIVE_ENV_HOOK_NAME.html +1 -1
- package/docs/api/variables/NOTEPAD_BASE_PATH.html +2 -2
- package/docs/api/variables/NOTEPAD_DEFAULT_CONFIG.html +1 -1
- package/docs/api/variables/NOTEPAD_DIR.html +2 -2
- package/docs/api/variables/NOTEPAD_FILENAME.html +1 -1
- package/docs/api/variables/OMC_ORCHESTRATOR_HOOK_NAME.html +4 -4
- package/docs/api/variables/ORCHESTRATOR_DELEGATION_REQUIRED.html +2 -2
- package/docs/api/variables/PATTERNS_HEADER.html +1 -1
- package/docs/api/variables/PLACEHOLDER_TEXT.html +3 -3
- package/docs/api/variables/PLANNER_PLANS_DIR.html +2 -2
- package/docs/api/variables/PLANNER_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/PLAN_EXTENSION.html +2 -2
- package/docs/api/variables/PRD_EXAMPLE_FILENAME.html +1 -1
- package/docs/api/variables/PRD_FILENAME.html +1 -1
- package/docs/api/variables/PREEMPTIVE_DEFAULT_THRESHOLD.html +2 -2
- package/docs/api/variables/PREVENTED_ERROR.html +2 -2
- package/docs/api/variables/PRIORITY_HEADER.html +1 -1
- package/docs/api/variables/PROGRESS_FILENAME.html +1 -1
- package/docs/api/variables/PROJECT_MARKERS.html +2 -2
- package/docs/api/variables/PROJECT_RULE_FILES.html +2 -2
- package/docs/api/variables/PROJECT_RULE_SUBDIRS.html +2 -2
- package/docs/api/variables/PROJECT_SKILLS_SUBDIR.html +2 -2
- package/docs/api/variables/RAPID_FIRE_DEBOUNCE_MS.html +7 -7
- package/docs/api/variables/README_FILENAME.html +2 -2
- package/docs/api/variables/README_INJECTOR_STORAGE.html +1 -1
- package/docs/api/variables/README_TRACKED_TOOLS.html +2 -2
- package/docs/api/variables/RECOVERY_FAILED_MESSAGE.html +2 -2
- package/docs/api/variables/RECOVERY_MESSAGES.html +2 -2
- package/docs/api/variables/RECOVERY_PLACEHOLDER_TEXT.html +2 -2
- package/docs/api/variables/REMINDER_MESSAGE.html +2 -2
- package/docs/api/variables/REPO_NAME.html +1 -1
- package/docs/api/variables/REPO_OWNER.html +2 -2
- package/docs/api/variables/RETRY_CONFIG.html +6 -6
- package/docs/api/variables/RULES_INJECTOR_STORAGE.html +1 -1
- package/docs/api/variables/RULE_EXTENSIONS.html +2 -2
- package/docs/api/variables/SHELL_COMMAND_PATTERNS.html +3 -3
- package/docs/api/variables/SINGLE_TASK_DIRECTIVE.html +2 -2
- package/docs/api/variables/SISYPHUS_JUNIOR_PROMPT_METADATA.html +1 -1
- package/docs/api/variables/SKILL_EXTENSION.html +2 -2
- package/docs/api/variables/SLASH_COMMAND_PATTERN.html +2 -2
- package/docs/api/variables/STALE_STATE_MAX_AGE_MS.html +2 -2
- package/docs/api/variables/SYNTHETIC_THINKING_ID_PREFIX.html +2 -2
- package/docs/api/variables/TARGET_TOOLS.html +2 -2
- package/docs/api/variables/THINKING_BLOCK_VALIDATOR_HOOK_NAME.html +2 -2
- package/docs/api/variables/THINKING_CONFIGS.html +2 -2
- package/docs/api/variables/THINKING_MODEL_PATTERNS.html +3 -3
- package/docs/api/variables/THINKING_PART_TYPES.html +2 -2
- package/docs/api/variables/TOKEN_LIMIT_KEYWORDS.html +2 -2
- package/docs/api/variables/TOKEN_LIMIT_PATTERNS.html +2 -2
- package/docs/api/variables/TOOL_PART_TYPES.html +2 -2
- package/docs/api/variables/TRACKED_TOOLS.html +2 -2
- package/docs/api/variables/TRUNCATE_CONFIG.html +6 -6
- package/docs/api/variables/TRUNCATION_APPLIED_MESSAGE.html +2 -2
- package/docs/api/variables/TYPE_CHECKER_PREFIXES.html +2 -2
- package/docs/api/variables/ULTRAPILOT_DEFAULT_CONFIG.html +2 -2
- package/docs/api/variables/USER_GATE_MESSAGE.html +1 -1
- package/docs/api/variables/USER_RULE_DIR.html +2 -2
- package/docs/api/variables/USER_SKILLS_DIR.html +2 -2
- package/docs/api/variables/VERIFICATION_REMINDER.html +2 -2
- package/docs/api/variables/VERSION_FILE.html +1 -1
- package/docs/api/variables/WORKING_MEMORY_HEADER.html +1 -1
- package/docs/api/variables/WRITE_EDIT_TOOLS.html +2 -2
- package/docs/api/variables/allCustomTools.html +3 -3
- package/docs/api/variables/analystAgent.html +1 -1
- package/docs/api/variables/architectAgent.html +1 -1
- package/docs/api/variables/astTools.html +2 -2
- package/docs/api/variables/contextCollector.html +2 -2
- package/docs/api/variables/criticAgent.html +1 -1
- package/docs/api/variables/designerAgent.html +1 -1
- package/docs/api/variables/executorAgent.html +1 -1
- package/docs/api/variables/exploreAgent.html +1 -1
- package/docs/api/variables/lspTools.html +2 -2
- package/docs/api/variables/nonInteractiveEnvHook.html +8 -8
- package/docs/api/variables/omcSystemPrompt.html +2 -2
- package/docs/api/variables/omcToolNames.html +3 -3
- package/docs/api/variables/omcToolsServer.html +4 -4
- package/docs/api/variables/plannerAgent.html +1 -1
- package/docs/api/variables/researcherAgent.html +1 -1
- package/docs/api/variables/visionAgent.html +1 -1
- package/docs/api/variables/writerAgent.html +1 -1
- package/docs/ccg-workflow/API.md +290 -130
- package/docs/ccg-workflow/BEST_PRACTICES.md +265 -124
- package/docs/ccg-workflow/README.md +29 -17
- package/docs/ccg-workflow/TROUBLESHOOTING.md +120 -63
- package/docs/ccg-workflow/VALIDATION_GUIDE.md +104 -46
- package/docs/design/AGENTS.md +8 -4
- package/docs/design/delegation-enforcer-integration.md +10 -8
- package/docs/design/project-session-manager.md +82 -29
- package/docs/dev-standards/context-collection.md +9 -2
- package/docs/dev-standards/context-summary-template.md +48 -24
- package/docs/dev-standards/dev-standards.md +28 -14
- package/docs/dev-standards/quality-review.md +24 -13
- package/docs/dev-standards/sufficiency-checklist.md +35 -14
- package/docs/dev-standards/tools-integration.md +34 -15
- package/docs/dev-standards/workflow.md +9 -3
- package/docs/getting-started/concepts.md +27 -14
- package/docs/getting-started/installation.md +25 -8
- package/docs/getting-started/quickstart.md +17 -8
- package/docs/guides/mcp-server-usage.md +24 -11
- package/docs/guides/task-templates-guide.md +50 -25
- package/docs/guides/tool-name-migration.md +67 -34
- package/docs/guides/troubleshooting-guide.md +66 -32
- package/docs/guides/v5.5.13-new-features.md +66 -31
- package/docs/guides/wizard-user-guide.md +27 -15
- package/docs/guides/workflow-recommendation-guide.md +22 -11
- package/docs/issues/AGENTS.md +4 -2
- package/docs/mcp/README.md +31 -18
- package/docs/mcp/client-guide.md +37 -19
- package/docs/mcp/configuration.md +27 -11
- package/docs/mcp/overview.md +70 -36
- package/docs/mcp/performance.md +23 -14
- package/docs/mcp/server-guide.md +9 -4
- package/docs/mcp-compatibility-matrix.md +36 -18
- package/docs/partials/AGENTS.md +4 -2
- package/docs/partials/agent-tiers.md +27 -17
- package/docs/partials/features.md +37 -21
- package/docs/partials/mode-hierarchy.md +19 -10
- package/docs/partials/mode-selection-guide.md +20 -10
- package/docs/partials/verification-tiers.md +36 -20
- package/docs/plans/2025-11-22-opencode-support-design.md +37 -25
- package/docs/plans/2025-11-22-opencode-support-implementation.md +93 -49
- package/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +195 -104
- package/docs/plans/2026-01-17-visual-brainstorming.md +48 -32
- package/docs/plans/2026-02-24-axiom-integration-design.md +121 -67
- package/docs/plans/2026-02-24-axiom-integration-plan.md +383 -191
- package/docs/plans/2026-02-24-superpowers-ultrapower-integration-design.md +210 -98
- package/docs/plans/2026-02-24-superpowers-ultrapower-integration-plan.md +251 -124
- package/docs/plans/2026-02-24-ultrapower-integration-design.md +9 -6
- package/docs/plans/2026-02-26-nexus-design.md +64 -38
- package/docs/plans/2026-02-26-nexus-implementation-plan.md +171 -98
- package/docs/plans/2026-02-26-phase2-active-learning-design.md +83 -44
- package/docs/plans/2026-02-27-release-cicd-pipeline-design.md +30 -19
- package/docs/plans/2026-02-27-release-cicd-pipeline-impl.md +27 -16
- package/docs/plans/2026-02-28-nexus-self-evolution.md +30 -17
- package/docs/plans/2026-03-02-docs-comprehensive-update-design.md +106 -34
- package/docs/plans/2026-03-02-docs-comprehensive-update.md +265 -133
- package/docs/plans/2026-03-05-mcp-adoption-atomic-tasks.md +409 -180
- package/docs/plans/2026-03-05-mcp-adoption-plan.md +278 -130
- package/docs/plans/AGENTS.md +6 -3
- package/docs/plans/axiom-migration-plan.md +127 -62
- package/docs/prd/AGENTS.md +6 -3
- package/docs/prd/documentation-system-draft.md +141 -71
- package/docs/prd/documentation-system-rough.md +330 -171
- package/docs/prd/memory-evolution-optimize-rough.md +199 -124
- package/docs/prd/user_guide-rough.md +403 -200
- package/docs/reviews/AGENTS.md +4 -2
- package/docs/reviews/documentation-system/review_critic.md +129 -58
- package/docs/reviews/documentation-system/review_domain.md +222 -104
- package/docs/reviews/documentation-system/review_product.md +61 -27
- package/docs/reviews/documentation-system/review_tech.md +86 -38
- package/docs/reviews/documentation-system/review_ux.md +70 -35
- package/docs/reviews/documentation-system/summary.md +94 -47
- package/docs/reviews/draft-prd-agent-observability/review_critic.md +21 -17
- package/docs/reviews/draft-prd-agent-observability/review_domain.md +61 -33
- package/docs/reviews/draft-prd-agent-observability/review_product.md +19 -12
- package/docs/reviews/draft-prd-agent-observability/review_tech.md +26 -15
- package/docs/reviews/draft-prd-agent-observability/review_ux.md +16 -12
- package/docs/reviews/draft-prd-agent-observability/rough_prd.md +64 -34
- package/docs/reviews/draft-prd-memory-evolution-optimize/review_critic.md +72 -43
- package/docs/reviews/draft-prd-memory-evolution-optimize/review_domain.md +45 -25
- package/docs/reviews/draft-prd-memory-evolution-optimize/review_product.md +5 -3
- package/docs/reviews/draft-prd-memory-evolution-optimize/review_tech.md +112 -61
- package/docs/reviews/draft-prd-memory-evolution-optimize/review_ux.md +1 -1
- package/docs/reviews/draft-prd-three-directions/review_product.md +49 -26
- package/docs/reviews/draft-prd-three-directions/review_tech.md +58 -34
- package/docs/reviews/draft-prd-three-directions/review_ux.md +83 -42
- package/docs/reviews/memory-evolution-optimize/summary.md +37 -22
- package/docs/reviews/ultrapower-pain-points/review_critic.md +95 -48
- package/docs/reviews/ultrapower-pain-points/review_ux.md +8 -7
- package/docs/reviews/ultrapower-security/review_critic.md +187 -91
- package/docs/reviews/ultrapower-standards/AGENTS.md +8 -4
- package/docs/reviews/ultrapower-standards/review_critic.md +62 -39
- package/docs/reviews/ultrapower-standards/review_domain.md +23 -14
- package/docs/reviews/ultrapower-standards/review_product.md +16 -9
- package/docs/reviews/ultrapower-standards/review_tech.md +47 -27
- package/docs/reviews/ultrapower-standards/review_ux.md +45 -26
- package/docs/reviews/ultrapower-standards/summary.md +54 -30
- package/docs/reviews/ultrapower-tech-review/review_tech.md +61 -34
- package/docs/reviews/user_guide/summary.md +44 -24
- package/docs/shared/AGENTS.md +4 -2
- package/docs/shared/agent-tiers.md +27 -17
- package/docs/shared/features.md +37 -21
- package/docs/shared/mode-hierarchy.md +19 -10
- package/docs/shared/mode-selection-guide.md +20 -10
- package/docs/shared/verification-tiers.md +36 -20
- package/docs/standards/AGENTS.md +9 -5
- package/docs/standards/README.md +16 -12
- package/docs/standards/agent-lifecycle.md +46 -32
- package/docs/standards/anti-patterns.md +2 -2
- package/docs/standards/audit-report.md +75 -42
- package/docs/standards/contribution-guide.md +74 -36
- package/docs/standards/hook-execution-order.md +26 -16
- package/docs/standards/release-process.md +9 -5
- package/docs/standards/runtime-protection.md +57 -36
- package/docs/standards/state-machine.md +15 -15
- package/docs/standards/templates/AGENTS.md +8 -4
- package/docs/standards/templates/agent-template.md +6 -4
- package/docs/standards/templates/hook-template.md +7 -5
- package/docs/standards/templates/skill-template.md +1 -1
- package/docs/standards/testing-guide.md +6 -4
- package/docs/standards/user-guide.md +27 -19
- package/docs/superpowers/AGENTS.md +6 -3
- package/docs/superpowers/plans/2026-01-22-document-review-system.md +46 -34
- package/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +71 -59
- package/docs/superpowers/plans/AGENTS.md +8 -4
- package/docs/superpowers/specs/2026-01-22-document-review-system-design.md +36 -19
- package/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +95 -49
- package/docs/superpowers/specs/AGENTS.md +8 -4
- package/docs/tasks/AGENTS.md +4 -2
- package/docs/tasks/documentation-system/implementation-plan.md +86 -38
- package/docs/tasks/documentation-system/manifest.md +328 -172
- package/docs/tasks/memory-evolution-optimize/manifest.md +148 -84
- package/docs/tasks/ultrapower-standards/AGENTS.md +10 -5
- package/docs/tasks/ultrapower-standards/manifest.md +137 -71
- package/docs/tasks/user_guide/manifest.md +185 -94
- package/docs/testing.md +29 -11
- package/docs/troubleshooting/agent-timeouts.md +14 -6
- package/docs/troubleshooting/common-errors.md +4 -0
- package/docs/troubleshooting/hook-failures.md +12 -6
- package/docs/troubleshooting/performance-issues.md +24 -12
- package/docs/troubleshooting/tool-name-length-error.md +1 -1
- package/docs/troubleshooting.md +215 -47
- package/docs/windows/AGENTS.md +6 -3
- package/docs/windows/polyglot-hooks.md +43 -19
- package/hooks/AGENTS.md +9 -5
- package/hooks/run-hook.cmd +0 -0
- package/hooks/session-start +0 -0
- package/package.json +1 -1
- package/scripts/AGENTS.md +28 -14
- package/scripts/fix-agent-headers.py +58 -0
- package/scripts/fix-blank-lines.py +19 -0
- package/scripts/fix-long-lines.py +41 -0
- package/scripts/fix-markdown-lint.mjs +48 -0
- package/scripts/hooks/AGENTS.md +8 -4
- package/scripts/lib/AGENTS.md +6 -3
- package/scripts/persistent-mode.cjs +605 -605
- package/skills/AGENTS.md +23 -17
- package/skills/analyze/AGENTS.md +12 -6
- package/skills/analyze/SKILL.md +53 -27
- package/skills/autopilot/AGENTS.md +12 -6
- package/skills/autopilot/SKILL.md +66 -35
- package/skills/ax-analyze-error/AGENTS.md +12 -6
- package/skills/ax-analyze-error/SKILL.md +9 -6
- package/skills/ax-context/AGENTS.md +12 -6
- package/skills/ax-context/SKILL.md +8 -2
- package/skills/ax-decompose/AGENTS.md +12 -6
- package/skills/ax-decompose/SKILL.md +19 -11
- package/skills/ax-draft/AGENTS.md +12 -6
- package/skills/ax-draft/SKILL.md +14 -8
- package/skills/ax-evolution/AGENTS.md +12 -6
- package/skills/ax-evolution/SKILL.md +16 -5
- package/skills/ax-evolve/AGENTS.md +12 -6
- package/skills/ax-evolve/SKILL.md +19 -10
- package/skills/ax-export/AGENTS.md +12 -6
- package/skills/ax-export/SKILL.md +50 -18
- package/skills/ax-implement/AGENTS.md +12 -6
- package/skills/ax-implement/SKILL.md +8 -5
- package/skills/ax-knowledge/AGENTS.md +17 -10
- package/skills/ax-knowledge/SKILL.md +54 -27
- package/skills/ax-reflect/AGENTS.md +12 -6
- package/skills/ax-reflect/SKILL.md +28 -14
- package/skills/ax-review/AGENTS.md +12 -6
- package/skills/ax-review/SKILL.md +14 -7
- package/skills/ax-rollback/AGENTS.md +12 -6
- package/skills/ax-rollback/SKILL.md +12 -5
- package/skills/ax-status/AGENTS.md +12 -6
- package/skills/ax-status/SKILL.md +55 -26
- package/skills/ax-suspend/AGENTS.md +12 -6
- package/skills/ax-suspend/SKILL.md +15 -7
- package/skills/brainstorming/AGENTS.md +12 -6
- package/skills/brainstorming/SKILL.md +66 -36
- package/skills/brainstorming/spec-document-reviewer-prompt.md +1 -1
- package/skills/brainstorming/visual-companion.md +57 -32
- package/skills/build-fix/AGENTS.md +12 -6
- package/skills/build-fix/SKILL.md +40 -22
- package/skills/cancel/AGENTS.md +12 -6
- package/skills/cancel/SKILL.md +102 -51
- package/skills/ccg/AGENTS.md +12 -6
- package/skills/ccg/SKILL.md +44 -24
- package/skills/ccg-workflow/SKILL.md +8 -3
- package/skills/code-review/AGENTS.md +12 -6
- package/skills/code-review/SKILL.md +100 -52
- package/skills/configure-discord/AGENTS.md +12 -6
- package/skills/configure-discord/SKILL.md +11 -5
- package/skills/configure-telegram/AGENTS.md +12 -6
- package/skills/configure-telegram/SKILL.md +23 -11
- package/skills/deepinit/AGENTS.md +12 -6
- package/skills/deepinit/SKILL.md +118 -55
- package/skills/deepsearch/AGENTS.md +12 -6
- package/skills/deepsearch/SKILL.md +9 -6
- package/skills/dispatching-parallel-agents/AGENTS.md +12 -6
- package/skills/dispatching-parallel-agents/SKILL.md +64 -32
- package/skills/executing-plans/AGENTS.md +12 -6
- package/skills/executing-plans/SKILL.md +78 -37
- package/skills/external-context/AGENTS.md +12 -6
- package/skills/external-context/SKILL.md +25 -10
- package/skills/finishing-a-development-branch/AGENTS.md +12 -6
- package/skills/finishing-a-development-branch/SKILL.md +69 -28
- package/skills/frontend-ui-ux/AGENTS.md +12 -6
- package/skills/frontend-ui-ux/SKILL.md +16 -7
- package/skills/git-master/AGENTS.md +12 -6
- package/skills/git-master/SKILL.md +10 -5
- package/skills/hud/AGENTS.md +12 -6
- package/skills/hud/SKILL.md +32 -21
- package/skills/learn-about-omc/AGENTS.md +12 -6
- package/skills/learn-about-omc/SKILL.md +2 -2
- package/skills/learner/AGENTS.md +12 -6
- package/skills/learner/SKILL.md +77 -39
- package/skills/mcp-setup/AGENTS.md +12 -6
- package/skills/mcp-setup/SKILL.md +120 -49
- package/skills/next-step-router/AGENTS.md +12 -6
- package/skills/next-step-router/SKILL.md +61 -36
- package/skills/nexus/AGENTS.md +11 -6
- package/skills/nexus/SKILL.md +8 -5
- package/skills/nexus/nexus-evolve/AGENTS.md +12 -6
- package/skills/nexus/nexus-review/AGENTS.md +12 -6
- package/skills/nexus/nexus-review/SKILL.md +1 -1
- package/skills/nexus/nexus-status/AGENTS.md +12 -6
- package/skills/note/AGENTS.md +12 -6
- package/skills/note/SKILL.md +23 -12
- package/skills/omc-doctor/AGENTS.md +12 -6
- package/skills/omc-doctor/SKILL.md +86 -32
- package/skills/omc-help/AGENTS.md +12 -6
- package/skills/omc-help/SKILL.md +39 -20
- package/skills/omc-setup/AGENTS.md +12 -6
- package/skills/omc-setup/SKILL.md +169 -91
- package/skills/pipeline/AGENTS.md +12 -6
- package/skills/pipeline/SKILL.md +36 -14
- package/skills/plan/AGENTS.md +12 -6
- package/skills/plan/SKILL.md +95 -51
- package/skills/project-session-manager/AGENTS.md +12 -6
- package/skills/project-session-manager/SKILL.md +76 -50
- package/skills/project-session-manager/lib/AGENTS.md +11 -6
- package/skills/project-session-manager/lib/providers/AGENTS.md +8 -4
- package/skills/project-session-manager/templates/AGENTS.md +8 -4
- package/skills/project-session-manager/templates/feature.md +21 -11
- package/skills/project-session-manager/templates/issue-fix.md +23 -12
- package/skills/project-session-manager/templates/pr-review.md +22 -12
- package/skills/psm/AGENTS.md +12 -6
- package/skills/ralph/AGENTS.md +12 -6
- package/skills/ralph/SKILL.md +86 -45
- package/skills/ralph-init/AGENTS.md +12 -6
- package/skills/ralph-init/SKILL.md +1 -1
- package/skills/ralplan/AGENTS.md +12 -6
- package/skills/receiving-code-review/AGENTS.md +12 -6
- package/skills/receiving-code-review/SKILL.md +50 -25
- package/skills/release/AGENTS.md +12 -6
- package/skills/release/SKILL.md +95 -30
- package/skills/requesting-code-review/AGENTS.md +12 -6
- package/skills/requesting-code-review/SKILL.md +64 -32
- package/skills/requesting-code-review/code-reviewer.md +89 -41
- package/skills/review/AGENTS.md +12 -6
- package/skills/sciomc/AGENTS.md +12 -6
- package/skills/sciomc/SKILL.md +86 -46
- package/skills/security-review/AGENTS.md +12 -6
- package/skills/security-review/SKILL.md +115 -61
- package/skills/skill/AGENTS.md +12 -6
- package/skills/skill/SKILL.md +93 -49
- package/skills/subagent-driven-development/AGENTS.md +12 -6
- package/skills/subagent-driven-development/SKILL.md +114 -58
- package/skills/swarm/AGENTS.md +12 -6
- package/skills/systematic-debugging/AGENTS.md +12 -6
- package/skills/systematic-debugging/CREATION-LOG.md +84 -42
- package/skills/systematic-debugging/SKILL.md +128 -73
- package/skills/systematic-debugging/condition-based-waiting.md +21 -11
- package/skills/systematic-debugging/defense-in-depth.md +29 -13
- package/skills/systematic-debugging/find-polluter.sh +0 -0
- package/skills/systematic-debugging/root-cause-tracing.md +41 -18
- package/skills/systematic-debugging/test-pressure-1.md +38 -19
- package/skills/systematic-debugging/test-pressure-2.md +50 -25
- package/skills/systematic-debugging/test-pressure-3.md +52 -26
- package/skills/team/AGENTS.md +12 -6
- package/skills/team/SKILL.md +139 -89
- package/skills/test-driven-development/AGENTS.md +12 -6
- package/skills/test-driven-development/SKILL.md +129 -67
- package/skills/test-driven-development/testing-anti-patterns.md +54 -28
- package/skills/trace/AGENTS.md +12 -6
- package/skills/trace/SKILL.md +14 -7
- package/skills/ultrapilot/AGENTS.md +12 -6
- package/skills/ultrapilot/SKILL.md +98 -51
- package/skills/ultraqa/AGENTS.md +12 -6
- package/skills/ultraqa/SKILL.md +8 -6
- package/skills/ultrawork/AGENTS.md +12 -6
- package/skills/ultrawork/SKILL.md +57 -30
- package/skills/using-git-worktrees/AGENTS.md +12 -6
- package/skills/using-git-worktrees/SKILL.md +63 -28
- package/skills/using-superpowers/AGENTS.md +12 -6
- package/skills/using-superpowers/SKILL.md +13 -7
- package/skills/using-superpowers/references/AGENTS.md +8 -4
- package/skills/using-superpowers/references/codex-tools.md +1 -1
- package/skills/verification-before-completion/AGENTS.md +12 -6
- package/skills/verification-before-completion/SKILL.md +54 -29
- package/skills/wizard/AGENTS.md +12 -6
- package/skills/wizard/SKILL.md +27 -15
- package/skills/writer-memory/AGENTS.md +12 -6
- package/skills/writer-memory/SKILL.md +73 -42
- package/skills/writer-memory/lib/AGENTS.md +8 -4
- package/skills/writer-memory/templates/AGENTS.md +10 -5
- package/skills/writing-plans/AGENTS.md +12 -6
- package/skills/writing-plans/SKILL.md +57 -28
- package/skills/writing-plans/plan-document-reviewer-prompt.md +1 -1
- package/skills/writing-skills/AGENTS.md +12 -6
- package/skills/writing-skills/SKILL.md +301 -134
- package/skills/writing-skills/anthropic-best-practices.md +155 -37
- package/skills/writing-skills/examples/AGENTS.md +8 -4
- package/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +37 -15
- package/skills/writing-skills/graphviz-conventions.dot +171 -171
- package/skills/writing-skills/persuasion-principles.md +124 -59
- package/skills/writing-skills/render-graphs.js +0 -0
- package/skills/writing-skills/testing-skills-with-subagents.md +119 -62
- package/templates/AGENTS.md +12 -8
- package/templates/axiom/AGENTS.md +7 -4
- package/templates/axiom/dag-analysis.md +1 -1
- package/templates/axiom/scripts/AGENTS.md +6 -3
- package/templates/axiom/scripts/Check-Memory.ps1 +68 -68
- package/templates/axiom/scripts/Poll-Memory.ps1 +36 -36
- package/templates/axiom/scripts/README.md +7 -4
- package/templates/axiom/scripts/Watch-Memory.ps1 +149 -149
- package/templates/axiom/scripts/agent-runner.ps1 +101 -101
- package/templates/axiom/scripts/start-reviews.ps1 +19 -19
- package/templates/axiom/task-execution.md +10 -6
- package/templates/hooks/AGENTS.md +9 -5
- package/templates/hooks/lib/AGENTS.md +4 -2
- package/templates/rules/AGENTS.md +8 -4
- package/templates/rules/README.md +5 -1
- package/templates/rules/axiom-gatekeepers.md +26 -16
- package/templates/rules/axiom-provider-router.md +12 -7
- package/templates/rules/axiom-router.md +8 -5
- package/templates/rules/coding-style.md +30 -15
- package/templates/rules/git-workflow.md +13 -7
- package/templates/rules/performance.md +38 -19
- package/templates/rules/security.md +24 -12
- package/templates/rules/testing.md +25 -13
- package/templates/tasks/README.md +15 -4
- package/templates/tasks/bug-fix.md +48 -24
- package/templates/tasks/code-review.md +46 -23
- package/templates/tasks/feature-development.md +56 -28
- package/templates/tasks/refactoring.md +48 -24
- package/templates/tasks/security-audit.md +48 -24
|
@@ -1,605 +1,605 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* OMC Persistent Mode Hook (Node.js)
|
|
5
|
-
* Minimal continuation enforcer for all OMC modes.
|
|
6
|
-
* Stripped down for reliability — no optional imports, no PRD, no notepad pruning.
|
|
7
|
-
*
|
|
8
|
-
* Supported modes: ralph, autopilot, ultrapilot, swarm, ultrawork, ultraqa, pipeline
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
const {
|
|
12
|
-
existsSync,
|
|
13
|
-
readFileSync,
|
|
14
|
-
writeFileSync,
|
|
15
|
-
readdirSync,
|
|
16
|
-
mkdirSync,
|
|
17
|
-
} = require("fs");
|
|
18
|
-
const { join, dirname, resolve, normalize } = require("path");
|
|
19
|
-
const { homedir } = require("os");
|
|
20
|
-
|
|
21
|
-
async function readStdin(timeoutMs = 5000) {
|
|
22
|
-
return new Promise((resolve) => {
|
|
23
|
-
const chunks = [];
|
|
24
|
-
let settled = false;
|
|
25
|
-
const timeout = setTimeout(() => {
|
|
26
|
-
if (!settled) { settled = true; process.stdin.removeAllListeners(); process.stdin.destroy(); resolve(Buffer.concat(chunks).toString("utf-8")); }
|
|
27
|
-
}, timeoutMs);
|
|
28
|
-
process.stdin.on("data", (chunk) => { chunks.push(chunk); });
|
|
29
|
-
process.stdin.on("end", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } });
|
|
30
|
-
process.stdin.on("error", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(""); } });
|
|
31
|
-
if (process.stdin.readableEnded) { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } }
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function readJsonFile(path) {
|
|
36
|
-
try {
|
|
37
|
-
if (!existsSync(path)) return null;
|
|
38
|
-
return JSON.parse(readFileSync(path, "utf-8"));
|
|
39
|
-
} catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function writeJsonFile(path, data) {
|
|
45
|
-
try {
|
|
46
|
-
// Ensure directory exists
|
|
47
|
-
const dir = dirname(path);
|
|
48
|
-
if (dir && dir !== "." && !existsSync(dir)) {
|
|
49
|
-
mkdirSync(dir, { recursive: true });
|
|
50
|
-
}
|
|
51
|
-
writeFileSync(path, JSON.stringify(data, null, 2));
|
|
52
|
-
return true;
|
|
53
|
-
} catch {
|
|
54
|
-
return false;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Send stop notification (fire-and-forget, non-blocking).
|
|
60
|
-
* Only notifies on first stop to avoid spam.
|
|
61
|
-
*/
|
|
62
|
-
async function sendStopNotification(modeName, stateData, sessionId, directory) {
|
|
63
|
-
// Only notify once per mode activation
|
|
64
|
-
if (stateData._stopNotified) return;
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
68
|
-
if (!pluginRoot) return;
|
|
69
|
-
|
|
70
|
-
const { pathToFileURL } = require('url');
|
|
71
|
-
const { notify } = await import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href);
|
|
72
|
-
|
|
73
|
-
await notify('session-stop', {
|
|
74
|
-
sessionId: sessionId,
|
|
75
|
-
projectPath: directory,
|
|
76
|
-
activeMode: modeName,
|
|
77
|
-
iteration: stateData.iteration || stateData.reinforcement_count || 1,
|
|
78
|
-
maxIterations: stateData.max_iterations || stateData.max_reinforcements || 100,
|
|
79
|
-
incompleteTasks: undefined, // Caller can override
|
|
80
|
-
}).catch(() => {});
|
|
81
|
-
|
|
82
|
-
// Mark as notified to prevent duplicate notifications
|
|
83
|
-
stateData._stopNotified = true;
|
|
84
|
-
} catch {
|
|
85
|
-
// Notification module not available, skip silently
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Staleness threshold for mode states (2 hours in milliseconds).
|
|
91
|
-
* States older than this are treated as inactive to prevent stale state
|
|
92
|
-
* from causing the stop hook to malfunction in new sessions.
|
|
93
|
-
*/
|
|
94
|
-
const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Check if a state is stale based on its timestamps.
|
|
98
|
-
* A state is considered stale if it hasn't been updated recently.
|
|
99
|
-
* We check both `last_checked_at` and `started_at` - using whichever is more recent.
|
|
100
|
-
*/
|
|
101
|
-
function isStaleState(state) {
|
|
102
|
-
if (!state) return true;
|
|
103
|
-
|
|
104
|
-
const lastChecked = state.last_checked_at
|
|
105
|
-
? new Date(state.last_checked_at).getTime()
|
|
106
|
-
: 0;
|
|
107
|
-
const startedAt = state.started_at ? new Date(state.started_at).getTime() : 0;
|
|
108
|
-
const mostRecent = Math.max(lastChecked, startedAt);
|
|
109
|
-
|
|
110
|
-
if (mostRecent === 0) return true; // No valid timestamps
|
|
111
|
-
|
|
112
|
-
const age = Date.now() - mostRecent;
|
|
113
|
-
return age > STALE_STATE_THRESHOLD_MS;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Normalize a path for comparison.
|
|
118
|
-
*/
|
|
119
|
-
function normalizePath(p) {
|
|
120
|
-
if (!p) return "";
|
|
121
|
-
let normalized = resolve(p);
|
|
122
|
-
normalized = normalize(normalized);
|
|
123
|
-
normalized = normalized.replace(/[\/\\]+$/, "");
|
|
124
|
-
if (process.platform === "win32") {
|
|
125
|
-
normalized = normalized.toLowerCase();
|
|
126
|
-
}
|
|
127
|
-
return normalized;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Check if a state belongs to the requesting session.
|
|
132
|
-
* When sessionId is known: require exact match with state.session_id.
|
|
133
|
-
* When sessionId is empty/unknown: only match state without session_id (legacy compat).
|
|
134
|
-
*/
|
|
135
|
-
function isSessionMatch(state, sessionId) {
|
|
136
|
-
if (!state) return false;
|
|
137
|
-
if (sessionId) {
|
|
138
|
-
// Session is known: require exact match
|
|
139
|
-
return state.session_id === sessionId;
|
|
140
|
-
}
|
|
141
|
-
// No session_id from hook: only match legacy state (no session_id in state)
|
|
142
|
-
return !state.session_id;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Check if a state belongs to the current project.
|
|
147
|
-
*/
|
|
148
|
-
function isStateForCurrentProject(
|
|
149
|
-
state,
|
|
150
|
-
currentDirectory,
|
|
151
|
-
isGlobalState = false,
|
|
152
|
-
) {
|
|
153
|
-
if (!state) return true;
|
|
154
|
-
|
|
155
|
-
if (!state.project_path) {
|
|
156
|
-
if (isGlobalState) {
|
|
157
|
-
return false;
|
|
158
|
-
}
|
|
159
|
-
return true;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
return normalizePath(state.project_path) === normalizePath(currentDirectory);
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Read state file from local location only.
|
|
167
|
-
*/
|
|
168
|
-
function readStateFile(stateDir, filename) {
|
|
169
|
-
const localPath = join(stateDir, filename);
|
|
170
|
-
const state = readJsonFile(localPath);
|
|
171
|
-
return { state, path: localPath, isGlobal: false };
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Read state file with session-scoped path support and fallback to legacy path.
|
|
176
|
-
*/
|
|
177
|
-
function readStateFileWithSession(stateDir, filename, sessionId) {
|
|
178
|
-
// Try session-scoped path first (and ONLY) when sessionId is available
|
|
179
|
-
if (sessionId && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) {
|
|
180
|
-
const sessionsDir = join(stateDir, 'sessions', sessionId);
|
|
181
|
-
const sessionPath = join(sessionsDir, filename);
|
|
182
|
-
const state = readJsonFile(sessionPath);
|
|
183
|
-
if (state) {
|
|
184
|
-
return { state, path: sessionPath, isGlobal: false };
|
|
185
|
-
}
|
|
186
|
-
// Session path not found — do NOT fall back to legacy
|
|
187
|
-
return { state: null, path: null, isGlobal: false };
|
|
188
|
-
}
|
|
189
|
-
// No sessionId: fall back to legacy path (backward compat)
|
|
190
|
-
return readStateFile(stateDir, filename);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* Count incomplete Tasks from Claude Code's native Task system.
|
|
195
|
-
*/
|
|
196
|
-
function countIncompleteTasks(sessionId) {
|
|
197
|
-
if (!sessionId || typeof sessionId !== "string") return 0;
|
|
198
|
-
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) return 0;
|
|
199
|
-
|
|
200
|
-
const cfgDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
201
|
-
const taskDir = join(cfgDir, "tasks", sessionId);
|
|
202
|
-
if (!existsSync(taskDir)) return 0;
|
|
203
|
-
|
|
204
|
-
let count = 0;
|
|
205
|
-
try {
|
|
206
|
-
const files = readdirSync(taskDir).filter(
|
|
207
|
-
(f) => f.endsWith(".json") && f !== ".lock",
|
|
208
|
-
);
|
|
209
|
-
for (const file of files) {
|
|
210
|
-
try {
|
|
211
|
-
const content = readFileSync(join(taskDir, file), "utf-8");
|
|
212
|
-
const task = JSON.parse(content);
|
|
213
|
-
if (task.status === "pending" || task.status === "in_progress") count++;
|
|
214
|
-
} catch {
|
|
215
|
-
/* skip */
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
} catch {
|
|
219
|
-
/* skip */
|
|
220
|
-
}
|
|
221
|
-
return count;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
function countIncompleteTodos(sessionId, projectDir) {
|
|
225
|
-
let count = 0;
|
|
226
|
-
|
|
227
|
-
// Session-specific todos only (no global scan)
|
|
228
|
-
if (
|
|
229
|
-
sessionId &&
|
|
230
|
-
typeof sessionId === "string" &&
|
|
231
|
-
/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)
|
|
232
|
-
) {
|
|
233
|
-
const sessionTodoPath = join(
|
|
234
|
-
homedir(),
|
|
235
|
-
".claude",
|
|
236
|
-
"todos",
|
|
237
|
-
`${sessionId}.json`,
|
|
238
|
-
);
|
|
239
|
-
try {
|
|
240
|
-
const data = readJsonFile(sessionTodoPath);
|
|
241
|
-
const todos = Array.isArray(data)
|
|
242
|
-
? data
|
|
243
|
-
: Array.isArray(data?.todos)
|
|
244
|
-
? data.todos
|
|
245
|
-
: [];
|
|
246
|
-
count += todos.filter(
|
|
247
|
-
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
248
|
-
).length;
|
|
249
|
-
} catch {
|
|
250
|
-
/* skip */
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
// Project-local todos only
|
|
255
|
-
for (const path of [
|
|
256
|
-
join(projectDir, ".omc", "todos.json"),
|
|
257
|
-
join(projectDir, ".claude", "todos.json"),
|
|
258
|
-
]) {
|
|
259
|
-
try {
|
|
260
|
-
const data = readJsonFile(path);
|
|
261
|
-
const todos = Array.isArray(data)
|
|
262
|
-
? data
|
|
263
|
-
: Array.isArray(data?.todos)
|
|
264
|
-
? data.todos
|
|
265
|
-
: [];
|
|
266
|
-
count += todos.filter(
|
|
267
|
-
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
268
|
-
).length;
|
|
269
|
-
} catch {
|
|
270
|
-
/* skip */
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
return count;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Detect if stop was triggered by context-limit related reasons.
|
|
279
|
-
* When context is exhausted, Claude Code needs to stop so it can compact.
|
|
280
|
-
* Blocking these stops causes a deadlock: can't compact because can't stop,
|
|
281
|
-
* can't continue because context is full.
|
|
282
|
-
*
|
|
283
|
-
* See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
284
|
-
*/
|
|
285
|
-
function isContextLimitStop(data) {
|
|
286
|
-
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
287
|
-
|
|
288
|
-
const contextPatterns = [
|
|
289
|
-
"context_limit",
|
|
290
|
-
"context_window",
|
|
291
|
-
"context_exceeded",
|
|
292
|
-
"context_full",
|
|
293
|
-
"max_context",
|
|
294
|
-
"token_limit",
|
|
295
|
-
"max_tokens",
|
|
296
|
-
"conversation_too_long",
|
|
297
|
-
"input_too_long",
|
|
298
|
-
];
|
|
299
|
-
|
|
300
|
-
if (contextPatterns.some((p) => reason.includes(p))) {
|
|
301
|
-
return true;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
const endTurnReason = (
|
|
305
|
-
data.end_turn_reason ||
|
|
306
|
-
data.endTurnReason ||
|
|
307
|
-
""
|
|
308
|
-
).toLowerCase();
|
|
309
|
-
if (endTurnReason && contextPatterns.some((p) => endTurnReason.includes(p))) {
|
|
310
|
-
return true;
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
return false;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* Detect if stop was triggered by user abort (Ctrl+C, cancel button, etc.)
|
|
318
|
-
*/
|
|
319
|
-
function isUserAbort(data) {
|
|
320
|
-
if (data.user_requested || data.userRequested) return true;
|
|
321
|
-
|
|
322
|
-
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
323
|
-
// Exact-match patterns: short generic words that cause false positives with .includes()
|
|
324
|
-
const exactPatterns = ["aborted", "abort", "cancel", "interrupt"];
|
|
325
|
-
// Substring patterns: compound words safe for .includes() matching
|
|
326
|
-
const substringPatterns = [
|
|
327
|
-
"user_cancel",
|
|
328
|
-
"user_interrupt",
|
|
329
|
-
"ctrl_c",
|
|
330
|
-
"manual_stop",
|
|
331
|
-
];
|
|
332
|
-
|
|
333
|
-
return (
|
|
334
|
-
exactPatterns.some((p) => reason === p) ||
|
|
335
|
-
substringPatterns.some((p) => reason.includes(p))
|
|
336
|
-
);
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
async function main() {
|
|
340
|
-
try {
|
|
341
|
-
const input = await readStdin();
|
|
342
|
-
let data = {};
|
|
343
|
-
try {
|
|
344
|
-
data = JSON.parse(input);
|
|
345
|
-
} catch {}
|
|
346
|
-
|
|
347
|
-
const directory = data.cwd || data.directory || process.cwd();
|
|
348
|
-
const sessionId = data.session_id || data.sessionId || "";
|
|
349
|
-
const stateDir = join(directory, ".omc", "state");
|
|
350
|
-
|
|
351
|
-
// CRITICAL: Never block context-limit stops.
|
|
352
|
-
// Blocking these causes a deadlock where Claude Code cannot compact.
|
|
353
|
-
// See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
354
|
-
if (isContextLimitStop(data)) {
|
|
355
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
356
|
-
return;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
// Respect user abort (Ctrl+C, cancel)
|
|
360
|
-
if (isUserAbort(data)) {
|
|
361
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
// Read all mode states (session-scoped with legacy fallback)
|
|
366
|
-
const ralph = readStateFileWithSession(stateDir, "ralph-state.json", sessionId);
|
|
367
|
-
const autopilot = readStateFileWithSession(stateDir, "autopilot-state.json", sessionId);
|
|
368
|
-
const ultrapilot = readStateFileWithSession(stateDir, "ultrapilot-state.json", sessionId);
|
|
369
|
-
const ultrawork = readStateFileWithSession(stateDir, "ultrawork-state.json", sessionId);
|
|
370
|
-
const ultraqa = readStateFileWithSession(stateDir, "ultraqa-state.json", sessionId);
|
|
371
|
-
const pipeline = readStateFileWithSession(stateDir, "pipeline-state.json", sessionId);
|
|
372
|
-
|
|
373
|
-
// Swarm uses swarm-summary.json (not swarm-state.json) + marker file
|
|
374
|
-
const swarmMarker = existsSync(join(stateDir, "swarm-active.marker"));
|
|
375
|
-
const swarmSummary = readJsonFile(join(stateDir, "swarm-summary.json"));
|
|
376
|
-
|
|
377
|
-
// Count incomplete items (session-specific + project-local only)
|
|
378
|
-
const taskCount = countIncompleteTasks(sessionId);
|
|
379
|
-
const todoCount = countIncompleteTodos(sessionId, directory);
|
|
380
|
-
const totalIncomplete = taskCount + todoCount;
|
|
381
|
-
|
|
382
|
-
// Priority 1: Ralph Loop (explicit persistence mode)
|
|
383
|
-
// Skip if state is stale (older than 2 hours) - prevents blocking new sessions
|
|
384
|
-
if (ralph.state?.active && !isStaleState(ralph.state) && isSessionMatch(ralph.state, sessionId)) {
|
|
385
|
-
const iteration = ralph.state.iteration || 1;
|
|
386
|
-
const maxIter = ralph.state.max_iterations || 100;
|
|
387
|
-
|
|
388
|
-
if (iteration < maxIter) {
|
|
389
|
-
ralph.state.iteration = iteration + 1;
|
|
390
|
-
ralph.state.last_checked_at = new Date().toISOString();
|
|
391
|
-
writeJsonFile(ralph.path, ralph.state);
|
|
392
|
-
|
|
393
|
-
// Fire-and-forget notification
|
|
394
|
-
sendStopNotification('ralph', ralph.state, sessionId, directory).catch(() => {});
|
|
395
|
-
|
|
396
|
-
console.log(
|
|
397
|
-
JSON.stringify({
|
|
398
|
-
decision: "block",
|
|
399
|
-
reason: `[RALPH LOOP - ITERATION ${iteration + 1}/${maxIter}] Work is NOT done. Continue working.\nWhen FULLY complete (after Architect verification), run /ultrapower:cancel to cleanly exit ralph mode and clean up all state files. If cancel fails, retry with /ultrapower:cancel --force.\n${ralph.state.prompt ? `Task: ${ralph.state.prompt}` : ""}`,
|
|
400
|
-
}),
|
|
401
|
-
);
|
|
402
|
-
return;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
// Priority 2: Autopilot (high-level orchestration)
|
|
407
|
-
if (autopilot.state?.active && !isStaleState(autopilot.state) && isSessionMatch(autopilot.state, sessionId)) {
|
|
408
|
-
const phase = autopilot.state.phase || "unknown";
|
|
409
|
-
if (phase !== "complete") {
|
|
410
|
-
const newCount = (autopilot.state.reinforcement_count || 0) + 1;
|
|
411
|
-
if (newCount <= 20) {
|
|
412
|
-
autopilot.state.reinforcement_count = newCount;
|
|
413
|
-
autopilot.state.last_checked_at = new Date().toISOString();
|
|
414
|
-
writeJsonFile(autopilot.path, autopilot.state);
|
|
415
|
-
|
|
416
|
-
// Fire-and-forget notification
|
|
417
|
-
sendStopNotification('autopilot', autopilot.state, sessionId, directory).catch(() => {});
|
|
418
|
-
|
|
419
|
-
console.log(
|
|
420
|
-
JSON.stringify({
|
|
421
|
-
decision: "block",
|
|
422
|
-
reason: `[AUTOPILOT - Phase: ${phase}] Autopilot not complete. Continue working. When all phases are complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
423
|
-
}),
|
|
424
|
-
);
|
|
425
|
-
return;
|
|
426
|
-
}
|
|
427
|
-
}
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
// Priority 3: Ultrapilot (parallel autopilot)
|
|
431
|
-
if (ultrapilot.state?.active && !isStaleState(ultrapilot.state) && isSessionMatch(ultrapilot.state, sessionId)) {
|
|
432
|
-
const workers = ultrapilot.state.workers || [];
|
|
433
|
-
const incomplete = workers.filter(
|
|
434
|
-
(w) => w.status !== "complete" && w.status !== "failed",
|
|
435
|
-
).length;
|
|
436
|
-
if (incomplete > 0) {
|
|
437
|
-
const newCount = (ultrapilot.state.reinforcement_count || 0) + 1;
|
|
438
|
-
if (newCount <= 20) {
|
|
439
|
-
ultrapilot.state.reinforcement_count = newCount;
|
|
440
|
-
ultrapilot.state.last_checked_at = new Date().toISOString();
|
|
441
|
-
writeJsonFile(ultrapilot.path, ultrapilot.state);
|
|
442
|
-
|
|
443
|
-
// Fire-and-forget notification
|
|
444
|
-
sendStopNotification('ultrapilot', ultrapilot.state, sessionId, directory).catch(() => {});
|
|
445
|
-
|
|
446
|
-
console.log(
|
|
447
|
-
JSON.stringify({
|
|
448
|
-
decision: "block",
|
|
449
|
-
reason: `[ULTRAPILOT] ${incomplete} workers still running. Continue working. When all workers complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
450
|
-
}),
|
|
451
|
-
);
|
|
452
|
-
return;
|
|
453
|
-
}
|
|
454
|
-
}
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
// Priority 4: Swarm (coordinated agents with SQLite)
|
|
458
|
-
if (swarmMarker && swarmSummary?.active && !isStaleState(swarmSummary)) {
|
|
459
|
-
const pending =
|
|
460
|
-
(swarmSummary.tasks_pending || 0) + (swarmSummary.tasks_claimed || 0);
|
|
461
|
-
if (pending > 0) {
|
|
462
|
-
const newCount = (swarmSummary.reinforcement_count || 0) + 1;
|
|
463
|
-
if (newCount <= 15) {
|
|
464
|
-
swarmSummary.reinforcement_count = newCount;
|
|
465
|
-
swarmSummary.last_checked_at = new Date().toISOString();
|
|
466
|
-
writeJsonFile(join(stateDir, "swarm-summary.json"), swarmSummary);
|
|
467
|
-
|
|
468
|
-
// Fire-and-forget notification
|
|
469
|
-
sendStopNotification('swarm', swarmSummary, sessionId, directory).catch(() => {});
|
|
470
|
-
|
|
471
|
-
console.log(
|
|
472
|
-
JSON.stringify({
|
|
473
|
-
decision: "block",
|
|
474
|
-
reason: `[SWARM ACTIVE] ${pending} tasks remain. Continue working. When all tasks are done, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
475
|
-
}),
|
|
476
|
-
);
|
|
477
|
-
return;
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
// Priority 5: Pipeline (sequential stages)
|
|
483
|
-
if (pipeline.state?.active && !isStaleState(pipeline.state) && isSessionMatch(pipeline.state, sessionId)) {
|
|
484
|
-
const currentStage = pipeline.state.current_stage || 0;
|
|
485
|
-
const totalStages = pipeline.state.stages?.length || 0;
|
|
486
|
-
if (currentStage < totalStages) {
|
|
487
|
-
const newCount = (pipeline.state.reinforcement_count || 0) + 1;
|
|
488
|
-
if (newCount <= 15) {
|
|
489
|
-
pipeline.state.reinforcement_count = newCount;
|
|
490
|
-
pipeline.state.last_checked_at = new Date().toISOString();
|
|
491
|
-
writeJsonFile(pipeline.path, pipeline.state);
|
|
492
|
-
|
|
493
|
-
// Fire-and-forget notification
|
|
494
|
-
sendStopNotification('pipeline', pipeline.state, sessionId, directory).catch(() => {});
|
|
495
|
-
|
|
496
|
-
console.log(
|
|
497
|
-
JSON.stringify({
|
|
498
|
-
decision: "block",
|
|
499
|
-
reason: `[PIPELINE - Stage ${currentStage + 1}/${totalStages}] Pipeline not complete. Continue working. When all stages complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
500
|
-
}),
|
|
501
|
-
);
|
|
502
|
-
return;
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
// Priority 6: UltraQA (QA cycling)
|
|
508
|
-
if (ultraqa.state?.active && !isStaleState(ultraqa.state) && isSessionMatch(ultraqa.state, sessionId)) {
|
|
509
|
-
const cycle = ultraqa.state.cycle || 1;
|
|
510
|
-
const maxCycles = ultraqa.state.max_cycles || 10;
|
|
511
|
-
if (cycle < maxCycles && !ultraqa.state.all_passing) {
|
|
512
|
-
ultraqa.state.cycle = cycle + 1;
|
|
513
|
-
ultraqa.state.last_checked_at = new Date().toISOString();
|
|
514
|
-
writeJsonFile(ultraqa.path, ultraqa.state);
|
|
515
|
-
|
|
516
|
-
// Fire-and-forget notification
|
|
517
|
-
sendStopNotification('ultraqa', ultraqa.state, sessionId, directory).catch(() => {});
|
|
518
|
-
|
|
519
|
-
console.log(
|
|
520
|
-
JSON.stringify({
|
|
521
|
-
decision: "block",
|
|
522
|
-
reason: `[ULTRAQA - Cycle ${cycle + 1}/${maxCycles}] Tests not all passing. Continue fixing. When all tests pass, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
523
|
-
}),
|
|
524
|
-
);
|
|
525
|
-
return;
|
|
526
|
-
}
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
// Priority 7: Ultrawork - ALWAYS continue while active (not just when tasks exist)
|
|
530
|
-
// This prevents false stops from bash errors, transient failures, etc.
|
|
531
|
-
// Session isolation: only block if state belongs to this session (issue #311)
|
|
532
|
-
// Project isolation: only block if state belongs to this project
|
|
533
|
-
if (
|
|
534
|
-
ultrawork.state?.active &&
|
|
535
|
-
!isStaleState(ultrawork.state) &&
|
|
536
|
-
isSessionMatch(ultrawork.state, sessionId) &&
|
|
537
|
-
isStateForCurrentProject(ultrawork.state, directory, ultrawork.isGlobal)
|
|
538
|
-
) {
|
|
539
|
-
const newCount = (ultrawork.state.reinforcement_count || 0) + 1;
|
|
540
|
-
const maxReinforcements = ultrawork.state.max_reinforcements || 50;
|
|
541
|
-
|
|
542
|
-
if (newCount > maxReinforcements) {
|
|
543
|
-
// Max reinforcements reached - allow stop
|
|
544
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
ultrawork.state.reinforcement_count = newCount;
|
|
549
|
-
ultrawork.state.last_checked_at = new Date().toISOString();
|
|
550
|
-
writeJsonFile(ultrawork.path, ultrawork.state);
|
|
551
|
-
|
|
552
|
-
// Fire-and-forget notification
|
|
553
|
-
sendStopNotification('ultrawork', ultrawork.state, sessionId, directory).catch(() => {});
|
|
554
|
-
|
|
555
|
-
let reason = `[ULTRAWORK #${newCount}/${maxReinforcements}] Mode active.`;
|
|
556
|
-
|
|
557
|
-
if (totalIncomplete > 0) {
|
|
558
|
-
const itemType = taskCount > 0 ? "Tasks" : "todos";
|
|
559
|
-
reason += ` ${totalIncomplete} incomplete ${itemType} remain. Continue working.`;
|
|
560
|
-
} else if (newCount >= 3) {
|
|
561
|
-
// Only suggest cancel after minimum iterations (guard against no-tasks-created scenario)
|
|
562
|
-
reason += ` If all work is complete, run /ultrapower:cancel to cleanly exit ultrawork mode and clean up state files. If cancel fails, retry with /ultrapower:cancel --force. Otherwise, continue working.`;
|
|
563
|
-
} else {
|
|
564
|
-
// Early iterations with no tasks yet - just tell LLM to continue
|
|
565
|
-
reason += ` Continue working - create Tasks to track your progress.`;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
if (ultrawork.state.original_prompt) {
|
|
569
|
-
reason += `\nTask: ${ultrawork.state.original_prompt}`;
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
console.log(JSON.stringify({ decision: "block", reason }));
|
|
573
|
-
return;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
// No blocking needed — Claude is truly idle.
|
|
577
|
-
// Send session-idle notification (fire-and-forget) so external integrations
|
|
578
|
-
// (Telegram, Discord) know the session went idle without any active mode.
|
|
579
|
-
if (sessionId) {
|
|
580
|
-
try {
|
|
581
|
-
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
582
|
-
if (pluginRoot) {
|
|
583
|
-
const { pathToFileURL } = require('url');
|
|
584
|
-
import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href)
|
|
585
|
-
.then(({ notify }) =>
|
|
586
|
-
notify('session-idle', {
|
|
587
|
-
sessionId,
|
|
588
|
-
projectPath: directory,
|
|
589
|
-
}).catch(() => {})
|
|
590
|
-
)
|
|
591
|
-
.catch(() => {});
|
|
592
|
-
}
|
|
593
|
-
} catch {
|
|
594
|
-
// Notification module not available, skip silently
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
598
|
-
} catch (error) {
|
|
599
|
-
// On any error, allow stop rather than blocking forever
|
|
600
|
-
console.error(`[persistent-mode] Error: ${error.message}`);
|
|
601
|
-
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
main();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* OMC Persistent Mode Hook (Node.js)
|
|
5
|
+
* Minimal continuation enforcer for all OMC modes.
|
|
6
|
+
* Stripped down for reliability — no optional imports, no PRD, no notepad pruning.
|
|
7
|
+
*
|
|
8
|
+
* Supported modes: ralph, autopilot, ultrapilot, swarm, ultrawork, ultraqa, pipeline
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
const {
|
|
12
|
+
existsSync,
|
|
13
|
+
readFileSync,
|
|
14
|
+
writeFileSync,
|
|
15
|
+
readdirSync,
|
|
16
|
+
mkdirSync,
|
|
17
|
+
} = require("fs");
|
|
18
|
+
const { join, dirname, resolve, normalize } = require("path");
|
|
19
|
+
const { homedir } = require("os");
|
|
20
|
+
|
|
21
|
+
async function readStdin(timeoutMs = 5000) {
|
|
22
|
+
return new Promise((resolve) => {
|
|
23
|
+
const chunks = [];
|
|
24
|
+
let settled = false;
|
|
25
|
+
const timeout = setTimeout(() => {
|
|
26
|
+
if (!settled) { settled = true; process.stdin.removeAllListeners(); process.stdin.destroy(); resolve(Buffer.concat(chunks).toString("utf-8")); }
|
|
27
|
+
}, timeoutMs);
|
|
28
|
+
process.stdin.on("data", (chunk) => { chunks.push(chunk); });
|
|
29
|
+
process.stdin.on("end", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } });
|
|
30
|
+
process.stdin.on("error", () => { if (!settled) { settled = true; clearTimeout(timeout); resolve(""); } });
|
|
31
|
+
if (process.stdin.readableEnded) { if (!settled) { settled = true; clearTimeout(timeout); resolve(Buffer.concat(chunks).toString("utf-8")); } }
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function readJsonFile(path) {
|
|
36
|
+
try {
|
|
37
|
+
if (!existsSync(path)) return null;
|
|
38
|
+
return JSON.parse(readFileSync(path, "utf-8"));
|
|
39
|
+
} catch {
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function writeJsonFile(path, data) {
|
|
45
|
+
try {
|
|
46
|
+
// Ensure directory exists
|
|
47
|
+
const dir = dirname(path);
|
|
48
|
+
if (dir && dir !== "." && !existsSync(dir)) {
|
|
49
|
+
mkdirSync(dir, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
writeFileSync(path, JSON.stringify(data, null, 2));
|
|
52
|
+
return true;
|
|
53
|
+
} catch {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Send stop notification (fire-and-forget, non-blocking).
|
|
60
|
+
* Only notifies on first stop to avoid spam.
|
|
61
|
+
*/
|
|
62
|
+
async function sendStopNotification(modeName, stateData, sessionId, directory) {
|
|
63
|
+
// Only notify once per mode activation
|
|
64
|
+
if (stateData._stopNotified) return;
|
|
65
|
+
|
|
66
|
+
try {
|
|
67
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
68
|
+
if (!pluginRoot) return;
|
|
69
|
+
|
|
70
|
+
const { pathToFileURL } = require('url');
|
|
71
|
+
const { notify } = await import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href);
|
|
72
|
+
|
|
73
|
+
await notify('session-stop', {
|
|
74
|
+
sessionId: sessionId,
|
|
75
|
+
projectPath: directory,
|
|
76
|
+
activeMode: modeName,
|
|
77
|
+
iteration: stateData.iteration || stateData.reinforcement_count || 1,
|
|
78
|
+
maxIterations: stateData.max_iterations || stateData.max_reinforcements || 100,
|
|
79
|
+
incompleteTasks: undefined, // Caller can override
|
|
80
|
+
}).catch(() => {});
|
|
81
|
+
|
|
82
|
+
// Mark as notified to prevent duplicate notifications
|
|
83
|
+
stateData._stopNotified = true;
|
|
84
|
+
} catch {
|
|
85
|
+
// Notification module not available, skip silently
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Staleness threshold for mode states (2 hours in milliseconds).
|
|
91
|
+
* States older than this are treated as inactive to prevent stale state
|
|
92
|
+
* from causing the stop hook to malfunction in new sessions.
|
|
93
|
+
*/
|
|
94
|
+
const STALE_STATE_THRESHOLD_MS = 2 * 60 * 60 * 1000; // 2 hours
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Check if a state is stale based on its timestamps.
|
|
98
|
+
* A state is considered stale if it hasn't been updated recently.
|
|
99
|
+
* We check both `last_checked_at` and `started_at` - using whichever is more recent.
|
|
100
|
+
*/
|
|
101
|
+
function isStaleState(state) {
|
|
102
|
+
if (!state) return true;
|
|
103
|
+
|
|
104
|
+
const lastChecked = state.last_checked_at
|
|
105
|
+
? new Date(state.last_checked_at).getTime()
|
|
106
|
+
: 0;
|
|
107
|
+
const startedAt = state.started_at ? new Date(state.started_at).getTime() : 0;
|
|
108
|
+
const mostRecent = Math.max(lastChecked, startedAt);
|
|
109
|
+
|
|
110
|
+
if (mostRecent === 0) return true; // No valid timestamps
|
|
111
|
+
|
|
112
|
+
const age = Date.now() - mostRecent;
|
|
113
|
+
return age > STALE_STATE_THRESHOLD_MS;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Normalize a path for comparison.
|
|
118
|
+
*/
|
|
119
|
+
function normalizePath(p) {
|
|
120
|
+
if (!p) return "";
|
|
121
|
+
let normalized = resolve(p);
|
|
122
|
+
normalized = normalize(normalized);
|
|
123
|
+
normalized = normalized.replace(/[\/\\]+$/, "");
|
|
124
|
+
if (process.platform === "win32") {
|
|
125
|
+
normalized = normalized.toLowerCase();
|
|
126
|
+
}
|
|
127
|
+
return normalized;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Check if a state belongs to the requesting session.
|
|
132
|
+
* When sessionId is known: require exact match with state.session_id.
|
|
133
|
+
* When sessionId is empty/unknown: only match state without session_id (legacy compat).
|
|
134
|
+
*/
|
|
135
|
+
function isSessionMatch(state, sessionId) {
|
|
136
|
+
if (!state) return false;
|
|
137
|
+
if (sessionId) {
|
|
138
|
+
// Session is known: require exact match
|
|
139
|
+
return state.session_id === sessionId;
|
|
140
|
+
}
|
|
141
|
+
// No session_id from hook: only match legacy state (no session_id in state)
|
|
142
|
+
return !state.session_id;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Check if a state belongs to the current project.
|
|
147
|
+
*/
|
|
148
|
+
function isStateForCurrentProject(
|
|
149
|
+
state,
|
|
150
|
+
currentDirectory,
|
|
151
|
+
isGlobalState = false,
|
|
152
|
+
) {
|
|
153
|
+
if (!state) return true;
|
|
154
|
+
|
|
155
|
+
if (!state.project_path) {
|
|
156
|
+
if (isGlobalState) {
|
|
157
|
+
return false;
|
|
158
|
+
}
|
|
159
|
+
return true;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return normalizePath(state.project_path) === normalizePath(currentDirectory);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Read state file from local location only.
|
|
167
|
+
*/
|
|
168
|
+
function readStateFile(stateDir, filename) {
|
|
169
|
+
const localPath = join(stateDir, filename);
|
|
170
|
+
const state = readJsonFile(localPath);
|
|
171
|
+
return { state, path: localPath, isGlobal: false };
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Read state file with session-scoped path support and fallback to legacy path.
|
|
176
|
+
*/
|
|
177
|
+
function readStateFileWithSession(stateDir, filename, sessionId) {
|
|
178
|
+
// Try session-scoped path first (and ONLY) when sessionId is available
|
|
179
|
+
if (sessionId && /^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) {
|
|
180
|
+
const sessionsDir = join(stateDir, 'sessions', sessionId);
|
|
181
|
+
const sessionPath = join(sessionsDir, filename);
|
|
182
|
+
const state = readJsonFile(sessionPath);
|
|
183
|
+
if (state) {
|
|
184
|
+
return { state, path: sessionPath, isGlobal: false };
|
|
185
|
+
}
|
|
186
|
+
// Session path not found — do NOT fall back to legacy
|
|
187
|
+
return { state: null, path: null, isGlobal: false };
|
|
188
|
+
}
|
|
189
|
+
// No sessionId: fall back to legacy path (backward compat)
|
|
190
|
+
return readStateFile(stateDir, filename);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* Count incomplete Tasks from Claude Code's native Task system.
|
|
195
|
+
*/
|
|
196
|
+
function countIncompleteTasks(sessionId) {
|
|
197
|
+
if (!sessionId || typeof sessionId !== "string") return 0;
|
|
198
|
+
if (!/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)) return 0;
|
|
199
|
+
|
|
200
|
+
const cfgDir = process.env.CLAUDE_CONFIG_DIR || join(homedir(), ".claude");
|
|
201
|
+
const taskDir = join(cfgDir, "tasks", sessionId);
|
|
202
|
+
if (!existsSync(taskDir)) return 0;
|
|
203
|
+
|
|
204
|
+
let count = 0;
|
|
205
|
+
try {
|
|
206
|
+
const files = readdirSync(taskDir).filter(
|
|
207
|
+
(f) => f.endsWith(".json") && f !== ".lock",
|
|
208
|
+
);
|
|
209
|
+
for (const file of files) {
|
|
210
|
+
try {
|
|
211
|
+
const content = readFileSync(join(taskDir, file), "utf-8");
|
|
212
|
+
const task = JSON.parse(content);
|
|
213
|
+
if (task.status === "pending" || task.status === "in_progress") count++;
|
|
214
|
+
} catch {
|
|
215
|
+
/* skip */
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
} catch {
|
|
219
|
+
/* skip */
|
|
220
|
+
}
|
|
221
|
+
return count;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function countIncompleteTodos(sessionId, projectDir) {
|
|
225
|
+
let count = 0;
|
|
226
|
+
|
|
227
|
+
// Session-specific todos only (no global scan)
|
|
228
|
+
if (
|
|
229
|
+
sessionId &&
|
|
230
|
+
typeof sessionId === "string" &&
|
|
231
|
+
/^[a-zA-Z0-9][a-zA-Z0-9_-]{0,255}$/.test(sessionId)
|
|
232
|
+
) {
|
|
233
|
+
const sessionTodoPath = join(
|
|
234
|
+
homedir(),
|
|
235
|
+
".claude",
|
|
236
|
+
"todos",
|
|
237
|
+
`${sessionId}.json`,
|
|
238
|
+
);
|
|
239
|
+
try {
|
|
240
|
+
const data = readJsonFile(sessionTodoPath);
|
|
241
|
+
const todos = Array.isArray(data)
|
|
242
|
+
? data
|
|
243
|
+
: Array.isArray(data?.todos)
|
|
244
|
+
? data.todos
|
|
245
|
+
: [];
|
|
246
|
+
count += todos.filter(
|
|
247
|
+
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
248
|
+
).length;
|
|
249
|
+
} catch {
|
|
250
|
+
/* skip */
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Project-local todos only
|
|
255
|
+
for (const path of [
|
|
256
|
+
join(projectDir, ".omc", "todos.json"),
|
|
257
|
+
join(projectDir, ".claude", "todos.json"),
|
|
258
|
+
]) {
|
|
259
|
+
try {
|
|
260
|
+
const data = readJsonFile(path);
|
|
261
|
+
const todos = Array.isArray(data)
|
|
262
|
+
? data
|
|
263
|
+
: Array.isArray(data?.todos)
|
|
264
|
+
? data.todos
|
|
265
|
+
: [];
|
|
266
|
+
count += todos.filter(
|
|
267
|
+
(t) => t.status !== "completed" && t.status !== "cancelled",
|
|
268
|
+
).length;
|
|
269
|
+
} catch {
|
|
270
|
+
/* skip */
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return count;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Detect if stop was triggered by context-limit related reasons.
|
|
279
|
+
* When context is exhausted, Claude Code needs to stop so it can compact.
|
|
280
|
+
* Blocking these stops causes a deadlock: can't compact because can't stop,
|
|
281
|
+
* can't continue because context is full.
|
|
282
|
+
*
|
|
283
|
+
* See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
284
|
+
*/
|
|
285
|
+
function isContextLimitStop(data) {
|
|
286
|
+
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
287
|
+
|
|
288
|
+
const contextPatterns = [
|
|
289
|
+
"context_limit",
|
|
290
|
+
"context_window",
|
|
291
|
+
"context_exceeded",
|
|
292
|
+
"context_full",
|
|
293
|
+
"max_context",
|
|
294
|
+
"token_limit",
|
|
295
|
+
"max_tokens",
|
|
296
|
+
"conversation_too_long",
|
|
297
|
+
"input_too_long",
|
|
298
|
+
];
|
|
299
|
+
|
|
300
|
+
if (contextPatterns.some((p) => reason.includes(p))) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
const endTurnReason = (
|
|
305
|
+
data.end_turn_reason ||
|
|
306
|
+
data.endTurnReason ||
|
|
307
|
+
""
|
|
308
|
+
).toLowerCase();
|
|
309
|
+
if (endTurnReason && contextPatterns.some((p) => endTurnReason.includes(p))) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
return false;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Detect if stop was triggered by user abort (Ctrl+C, cancel button, etc.)
|
|
318
|
+
*/
|
|
319
|
+
function isUserAbort(data) {
|
|
320
|
+
if (data.user_requested || data.userRequested) return true;
|
|
321
|
+
|
|
322
|
+
const reason = (data.stop_reason || data.stopReason || "").toLowerCase();
|
|
323
|
+
// Exact-match patterns: short generic words that cause false positives with .includes()
|
|
324
|
+
const exactPatterns = ["aborted", "abort", "cancel", "interrupt"];
|
|
325
|
+
// Substring patterns: compound words safe for .includes() matching
|
|
326
|
+
const substringPatterns = [
|
|
327
|
+
"user_cancel",
|
|
328
|
+
"user_interrupt",
|
|
329
|
+
"ctrl_c",
|
|
330
|
+
"manual_stop",
|
|
331
|
+
];
|
|
332
|
+
|
|
333
|
+
return (
|
|
334
|
+
exactPatterns.some((p) => reason === p) ||
|
|
335
|
+
substringPatterns.some((p) => reason.includes(p))
|
|
336
|
+
);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
async function main() {
|
|
340
|
+
try {
|
|
341
|
+
const input = await readStdin();
|
|
342
|
+
let data = {};
|
|
343
|
+
try {
|
|
344
|
+
data = JSON.parse(input);
|
|
345
|
+
} catch {}
|
|
346
|
+
|
|
347
|
+
const directory = data.cwd || data.directory || process.cwd();
|
|
348
|
+
const sessionId = data.session_id || data.sessionId || "";
|
|
349
|
+
const stateDir = join(directory, ".omc", "state");
|
|
350
|
+
|
|
351
|
+
// CRITICAL: Never block context-limit stops.
|
|
352
|
+
// Blocking these causes a deadlock where Claude Code cannot compact.
|
|
353
|
+
// See: https://github.com/liangjie559567/ultrapower/issues/213
|
|
354
|
+
if (isContextLimitStop(data)) {
|
|
355
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Respect user abort (Ctrl+C, cancel)
|
|
360
|
+
if (isUserAbort(data)) {
|
|
361
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Read all mode states (session-scoped with legacy fallback)
|
|
366
|
+
const ralph = readStateFileWithSession(stateDir, "ralph-state.json", sessionId);
|
|
367
|
+
const autopilot = readStateFileWithSession(stateDir, "autopilot-state.json", sessionId);
|
|
368
|
+
const ultrapilot = readStateFileWithSession(stateDir, "ultrapilot-state.json", sessionId);
|
|
369
|
+
const ultrawork = readStateFileWithSession(stateDir, "ultrawork-state.json", sessionId);
|
|
370
|
+
const ultraqa = readStateFileWithSession(stateDir, "ultraqa-state.json", sessionId);
|
|
371
|
+
const pipeline = readStateFileWithSession(stateDir, "pipeline-state.json", sessionId);
|
|
372
|
+
|
|
373
|
+
// Swarm uses swarm-summary.json (not swarm-state.json) + marker file
|
|
374
|
+
const swarmMarker = existsSync(join(stateDir, "swarm-active.marker"));
|
|
375
|
+
const swarmSummary = readJsonFile(join(stateDir, "swarm-summary.json"));
|
|
376
|
+
|
|
377
|
+
// Count incomplete items (session-specific + project-local only)
|
|
378
|
+
const taskCount = countIncompleteTasks(sessionId);
|
|
379
|
+
const todoCount = countIncompleteTodos(sessionId, directory);
|
|
380
|
+
const totalIncomplete = taskCount + todoCount;
|
|
381
|
+
|
|
382
|
+
// Priority 1: Ralph Loop (explicit persistence mode)
|
|
383
|
+
// Skip if state is stale (older than 2 hours) - prevents blocking new sessions
|
|
384
|
+
if (ralph.state?.active && !isStaleState(ralph.state) && isSessionMatch(ralph.state, sessionId)) {
|
|
385
|
+
const iteration = ralph.state.iteration || 1;
|
|
386
|
+
const maxIter = ralph.state.max_iterations || 100;
|
|
387
|
+
|
|
388
|
+
if (iteration < maxIter) {
|
|
389
|
+
ralph.state.iteration = iteration + 1;
|
|
390
|
+
ralph.state.last_checked_at = new Date().toISOString();
|
|
391
|
+
writeJsonFile(ralph.path, ralph.state);
|
|
392
|
+
|
|
393
|
+
// Fire-and-forget notification
|
|
394
|
+
sendStopNotification('ralph', ralph.state, sessionId, directory).catch(() => {});
|
|
395
|
+
|
|
396
|
+
console.log(
|
|
397
|
+
JSON.stringify({
|
|
398
|
+
decision: "block",
|
|
399
|
+
reason: `[RALPH LOOP - ITERATION ${iteration + 1}/${maxIter}] Work is NOT done. Continue working.\nWhen FULLY complete (after Architect verification), run /ultrapower:cancel to cleanly exit ralph mode and clean up all state files. If cancel fails, retry with /ultrapower:cancel --force.\n${ralph.state.prompt ? `Task: ${ralph.state.prompt}` : ""}`,
|
|
400
|
+
}),
|
|
401
|
+
);
|
|
402
|
+
return;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
// Priority 2: Autopilot (high-level orchestration)
|
|
407
|
+
if (autopilot.state?.active && !isStaleState(autopilot.state) && isSessionMatch(autopilot.state, sessionId)) {
|
|
408
|
+
const phase = autopilot.state.phase || "unknown";
|
|
409
|
+
if (phase !== "complete") {
|
|
410
|
+
const newCount = (autopilot.state.reinforcement_count || 0) + 1;
|
|
411
|
+
if (newCount <= 20) {
|
|
412
|
+
autopilot.state.reinforcement_count = newCount;
|
|
413
|
+
autopilot.state.last_checked_at = new Date().toISOString();
|
|
414
|
+
writeJsonFile(autopilot.path, autopilot.state);
|
|
415
|
+
|
|
416
|
+
// Fire-and-forget notification
|
|
417
|
+
sendStopNotification('autopilot', autopilot.state, sessionId, directory).catch(() => {});
|
|
418
|
+
|
|
419
|
+
console.log(
|
|
420
|
+
JSON.stringify({
|
|
421
|
+
decision: "block",
|
|
422
|
+
reason: `[AUTOPILOT - Phase: ${phase}] Autopilot not complete. Continue working. When all phases are complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
423
|
+
}),
|
|
424
|
+
);
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
// Priority 3: Ultrapilot (parallel autopilot)
|
|
431
|
+
if (ultrapilot.state?.active && !isStaleState(ultrapilot.state) && isSessionMatch(ultrapilot.state, sessionId)) {
|
|
432
|
+
const workers = ultrapilot.state.workers || [];
|
|
433
|
+
const incomplete = workers.filter(
|
|
434
|
+
(w) => w.status !== "complete" && w.status !== "failed",
|
|
435
|
+
).length;
|
|
436
|
+
if (incomplete > 0) {
|
|
437
|
+
const newCount = (ultrapilot.state.reinforcement_count || 0) + 1;
|
|
438
|
+
if (newCount <= 20) {
|
|
439
|
+
ultrapilot.state.reinforcement_count = newCount;
|
|
440
|
+
ultrapilot.state.last_checked_at = new Date().toISOString();
|
|
441
|
+
writeJsonFile(ultrapilot.path, ultrapilot.state);
|
|
442
|
+
|
|
443
|
+
// Fire-and-forget notification
|
|
444
|
+
sendStopNotification('ultrapilot', ultrapilot.state, sessionId, directory).catch(() => {});
|
|
445
|
+
|
|
446
|
+
console.log(
|
|
447
|
+
JSON.stringify({
|
|
448
|
+
decision: "block",
|
|
449
|
+
reason: `[ULTRAPILOT] ${incomplete} workers still running. Continue working. When all workers complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
450
|
+
}),
|
|
451
|
+
);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Priority 4: Swarm (coordinated agents with SQLite)
|
|
458
|
+
if (swarmMarker && swarmSummary?.active && !isStaleState(swarmSummary)) {
|
|
459
|
+
const pending =
|
|
460
|
+
(swarmSummary.tasks_pending || 0) + (swarmSummary.tasks_claimed || 0);
|
|
461
|
+
if (pending > 0) {
|
|
462
|
+
const newCount = (swarmSummary.reinforcement_count || 0) + 1;
|
|
463
|
+
if (newCount <= 15) {
|
|
464
|
+
swarmSummary.reinforcement_count = newCount;
|
|
465
|
+
swarmSummary.last_checked_at = new Date().toISOString();
|
|
466
|
+
writeJsonFile(join(stateDir, "swarm-summary.json"), swarmSummary);
|
|
467
|
+
|
|
468
|
+
// Fire-and-forget notification
|
|
469
|
+
sendStopNotification('swarm', swarmSummary, sessionId, directory).catch(() => {});
|
|
470
|
+
|
|
471
|
+
console.log(
|
|
472
|
+
JSON.stringify({
|
|
473
|
+
decision: "block",
|
|
474
|
+
reason: `[SWARM ACTIVE] ${pending} tasks remain. Continue working. When all tasks are done, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
475
|
+
}),
|
|
476
|
+
);
|
|
477
|
+
return;
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
// Priority 5: Pipeline (sequential stages)
|
|
483
|
+
if (pipeline.state?.active && !isStaleState(pipeline.state) && isSessionMatch(pipeline.state, sessionId)) {
|
|
484
|
+
const currentStage = pipeline.state.current_stage || 0;
|
|
485
|
+
const totalStages = pipeline.state.stages?.length || 0;
|
|
486
|
+
if (currentStage < totalStages) {
|
|
487
|
+
const newCount = (pipeline.state.reinforcement_count || 0) + 1;
|
|
488
|
+
if (newCount <= 15) {
|
|
489
|
+
pipeline.state.reinforcement_count = newCount;
|
|
490
|
+
pipeline.state.last_checked_at = new Date().toISOString();
|
|
491
|
+
writeJsonFile(pipeline.path, pipeline.state);
|
|
492
|
+
|
|
493
|
+
// Fire-and-forget notification
|
|
494
|
+
sendStopNotification('pipeline', pipeline.state, sessionId, directory).catch(() => {});
|
|
495
|
+
|
|
496
|
+
console.log(
|
|
497
|
+
JSON.stringify({
|
|
498
|
+
decision: "block",
|
|
499
|
+
reason: `[PIPELINE - Stage ${currentStage + 1}/${totalStages}] Pipeline not complete. Continue working. When all stages complete, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
500
|
+
}),
|
|
501
|
+
);
|
|
502
|
+
return;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// Priority 6: UltraQA (QA cycling)
|
|
508
|
+
if (ultraqa.state?.active && !isStaleState(ultraqa.state) && isSessionMatch(ultraqa.state, sessionId)) {
|
|
509
|
+
const cycle = ultraqa.state.cycle || 1;
|
|
510
|
+
const maxCycles = ultraqa.state.max_cycles || 10;
|
|
511
|
+
if (cycle < maxCycles && !ultraqa.state.all_passing) {
|
|
512
|
+
ultraqa.state.cycle = cycle + 1;
|
|
513
|
+
ultraqa.state.last_checked_at = new Date().toISOString();
|
|
514
|
+
writeJsonFile(ultraqa.path, ultraqa.state);
|
|
515
|
+
|
|
516
|
+
// Fire-and-forget notification
|
|
517
|
+
sendStopNotification('ultraqa', ultraqa.state, sessionId, directory).catch(() => {});
|
|
518
|
+
|
|
519
|
+
console.log(
|
|
520
|
+
JSON.stringify({
|
|
521
|
+
decision: "block",
|
|
522
|
+
reason: `[ULTRAQA - Cycle ${cycle + 1}/${maxCycles}] Tests not all passing. Continue fixing. When all tests pass, run /ultrapower:cancel to cleanly exit and clean up state files. If cancel fails, retry with /ultrapower:cancel --force.`,
|
|
523
|
+
}),
|
|
524
|
+
);
|
|
525
|
+
return;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// Priority 7: Ultrawork - ALWAYS continue while active (not just when tasks exist)
|
|
530
|
+
// This prevents false stops from bash errors, transient failures, etc.
|
|
531
|
+
// Session isolation: only block if state belongs to this session (issue #311)
|
|
532
|
+
// Project isolation: only block if state belongs to this project
|
|
533
|
+
if (
|
|
534
|
+
ultrawork.state?.active &&
|
|
535
|
+
!isStaleState(ultrawork.state) &&
|
|
536
|
+
isSessionMatch(ultrawork.state, sessionId) &&
|
|
537
|
+
isStateForCurrentProject(ultrawork.state, directory, ultrawork.isGlobal)
|
|
538
|
+
) {
|
|
539
|
+
const newCount = (ultrawork.state.reinforcement_count || 0) + 1;
|
|
540
|
+
const maxReinforcements = ultrawork.state.max_reinforcements || 50;
|
|
541
|
+
|
|
542
|
+
if (newCount > maxReinforcements) {
|
|
543
|
+
// Max reinforcements reached - allow stop
|
|
544
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
ultrawork.state.reinforcement_count = newCount;
|
|
549
|
+
ultrawork.state.last_checked_at = new Date().toISOString();
|
|
550
|
+
writeJsonFile(ultrawork.path, ultrawork.state);
|
|
551
|
+
|
|
552
|
+
// Fire-and-forget notification
|
|
553
|
+
sendStopNotification('ultrawork', ultrawork.state, sessionId, directory).catch(() => {});
|
|
554
|
+
|
|
555
|
+
let reason = `[ULTRAWORK #${newCount}/${maxReinforcements}] Mode active.`;
|
|
556
|
+
|
|
557
|
+
if (totalIncomplete > 0) {
|
|
558
|
+
const itemType = taskCount > 0 ? "Tasks" : "todos";
|
|
559
|
+
reason += ` ${totalIncomplete} incomplete ${itemType} remain. Continue working.`;
|
|
560
|
+
} else if (newCount >= 3) {
|
|
561
|
+
// Only suggest cancel after minimum iterations (guard against no-tasks-created scenario)
|
|
562
|
+
reason += ` If all work is complete, run /ultrapower:cancel to cleanly exit ultrawork mode and clean up state files. If cancel fails, retry with /ultrapower:cancel --force. Otherwise, continue working.`;
|
|
563
|
+
} else {
|
|
564
|
+
// Early iterations with no tasks yet - just tell LLM to continue
|
|
565
|
+
reason += ` Continue working - create Tasks to track your progress.`;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
if (ultrawork.state.original_prompt) {
|
|
569
|
+
reason += `\nTask: ${ultrawork.state.original_prompt}`;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
console.log(JSON.stringify({ decision: "block", reason }));
|
|
573
|
+
return;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
// No blocking needed — Claude is truly idle.
|
|
577
|
+
// Send session-idle notification (fire-and-forget) so external integrations
|
|
578
|
+
// (Telegram, Discord) know the session went idle without any active mode.
|
|
579
|
+
if (sessionId) {
|
|
580
|
+
try {
|
|
581
|
+
const pluginRoot = process.env.CLAUDE_PLUGIN_ROOT;
|
|
582
|
+
if (pluginRoot) {
|
|
583
|
+
const { pathToFileURL } = require('url');
|
|
584
|
+
import(pathToFileURL(join(pluginRoot, 'dist', 'notifications', 'index.js')).href)
|
|
585
|
+
.then(({ notify }) =>
|
|
586
|
+
notify('session-idle', {
|
|
587
|
+
sessionId,
|
|
588
|
+
projectPath: directory,
|
|
589
|
+
}).catch(() => {})
|
|
590
|
+
)
|
|
591
|
+
.catch(() => {});
|
|
592
|
+
}
|
|
593
|
+
} catch {
|
|
594
|
+
// Notification module not available, skip silently
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
598
|
+
} catch (error) {
|
|
599
|
+
// On any error, allow stop rather than blocking forever
|
|
600
|
+
console.error(`[persistent-mode] Error: ${error.message}`);
|
|
601
|
+
console.log(JSON.stringify({ continue: true, suppressOutput: true }));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
main();
|