@wolfx/oh-my-openagent 4.0.0 → 4.1.2
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/README.ja.md +29 -4
- package/README.ko.md +29 -4
- package/README.md +29 -4
- package/README.ru.md +29 -4
- package/README.zh-cn.md +29 -4
- package/dist/agents/atlas/agent.d.ts +7 -12
- package/dist/agents/atlas/default-prompt-sections.d.ts +5 -5
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +4 -4
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +5 -5
- package/dist/agents/atlas/kimi-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/kimi.d.ts +2 -0
- package/dist/agents/atlas/opus-4-7-prompt-sections.d.ts +6 -0
- package/dist/agents/atlas/opus-4-7.d.ts +2 -0
- package/dist/agents/atlas/shared-prompt.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +1 -0
- package/dist/create-hooks.d.ts +1 -0
- package/dist/create-managers.d.ts +2 -0
- package/dist/features/background-agent/manager.d.ts +10 -0
- package/dist/features/background-agent/spawner.d.ts +4 -2
- package/dist/features/background-agent/task-poller.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +1 -0
- package/dist/features/boulder-state/format-duration.d.ts +1 -0
- package/dist/features/boulder-state/index.d.ts +1 -0
- package/dist/features/boulder-state/storage.d.ts +39 -1
- package/dist/features/boulder-state/types.d.ts +43 -0
- package/dist/features/builtin-commands/templates/start-work.d.ts +1 -1
- package/dist/features/team-mode/team-runtime/session-cleanup.d.ts +21 -0
- package/dist/features/team-mode/team-runtime/session-team-run-registry.d.ts +4 -0
- package/dist/features/tmux-subagent/cleanup.d.ts +10 -0
- package/dist/features/tmux-subagent/session-created-handler.d.ts +23 -0
- package/dist/features/tmux-subagent/session-deleted-handler.d.ts +16 -0
- package/dist/hooks/atlas/boulder-continuation-injector.d.ts +1 -1
- package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -0
- package/dist/hooks/atlas/tool-execute-after.d.ts +1 -0
- package/dist/hooks/atlas/tool-execute-before.d.ts +1 -0
- package/dist/hooks/atlas/types.d.ts +2 -0
- package/dist/hooks/compaction-context-injector/recovery.d.ts +1 -1
- package/dist/hooks/compaction-context-injector/types.d.ts +1 -0
- package/dist/hooks/compaction-todo-preserver/hook.d.ts +11 -0
- package/dist/hooks/fsync-skip-warning/index.d.ts +18 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +7 -1
- package/dist/hooks/ralph-loop/iteration-continuation.d.ts +10 -1
- package/dist/hooks/ralph-loop/loop-state-controller.d.ts +4 -3
- package/dist/hooks/ralph-loop/pending-verification-handler.d.ts +4 -0
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +4 -2
- package/dist/hooks/ralph-loop/storage.d.ts +2 -2
- package/dist/hooks/ralph-loop/types.d.ts +5 -0
- package/dist/hooks/ralph-loop/verification-failure-handler.d.ts +4 -2
- package/dist/hooks/shared/session-idle-settle.d.ts +11 -0
- package/dist/hooks/team-session-events/team-idle-wake-hint.d.ts +5 -1
- package/dist/hooks/todo-description-override/description.d.ts +1 -1
- package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
- package/dist/index.js +11904 -3713
- package/dist/oh-my-opencode.schema.json +8 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/session-compacting.d.ts +31 -0
- package/dist/plugin-dispose.d.ts +13 -0
- package/dist/plugin-handlers/agent-priority-order.d.ts +6 -6
- package/dist/shared/agent-ordering.d.ts +8 -0
- package/dist/shared/agent-sort-shim.d.ts +8 -8
- package/dist/shared/agent-tool-restrictions.d.ts +5 -1
- package/dist/shared/bun-file-shim.d.ts +8 -0
- package/dist/shared/bun-hash-shim.d.ts +1 -0
- package/dist/shared/bun-which-shim.d.ts +1 -0
- package/dist/shared/classify-path-environment.d.ts +3 -0
- package/dist/shared/event-session-id.d.ts +2 -0
- package/dist/shared/extract-semver.d.ts +1 -0
- package/dist/shared/fsync-skip-tracker.d.ts +12 -0
- package/dist/shared/fsync-skip-warning-formatter.d.ts +2 -0
- package/dist/shared/index.d.ts +3 -0
- package/dist/shared/internal-initiator-marker.d.ts +8 -0
- package/dist/shared/model-capability-heuristics.d.ts +1 -0
- package/dist/shared/opencode-version.d.ts +14 -1
- package/dist/shared/session-route.d.ts +18 -0
- package/dist/shared/tmux/cmux-detect.d.ts +8 -0
- package/dist/shared/tmux/index.d.ts +1 -0
- package/dist/shared/tolerant-fsync.d.ts +5 -0
- package/dist/shared/write-file-atomically.d.ts +4 -1
- package/dist/tools/call-omo-agent/agent-resolver.d.ts +5 -12
- package/dist/tools/call-omo-agent/constants.d.ts +2 -2
- package/dist/tools/delegate-task/model-string-parser.d.ts +9 -0
- package/dist/tools/delegate-task/resolve-call-id.d.ts +2 -0
- package/dist/tools/delegate-task/subagent-discovery.d.ts +1 -0
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -0
- package/dist/tools/delegate-task/sync-result-fetcher.d.ts +3 -1
- package/dist/tools/interactive-bash/constants.d.ts +1 -0
- package/dist/tools/interactive-bash/tmux-path-resolver.d.ts +1 -0
- package/package.json +16 -11
- package/dist/hooks/ralph-loop/completion-promise-detector-test-input.d.ts +0 -11
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export declare const DIRECT_WORK_REMINDER: string;
|
|
2
2
|
export declare const BOULDER_CONTINUATION_PROMPT: string;
|
|
3
|
+
export declare const BOULDER_COMPLETE_PROMPT = "<system-reminder>\nBOULDER COMPLETE: plan \"{PLAN_NAME}\" is fully checked.\n\nTotal elapsed: {ELAPSED_HUMAN}\n\nPer-task breakdown:\n{TASK_BREAKDOWN}\n\nPer your <boulder_completion_response> instructions, print the final ORCHESTRATION COMPLETE summary in your next turn. This nudge fires at most once.\n</system-reminder>";
|
|
3
4
|
export declare const VERIFICATION_REMINDER = "**THE SUBAGENT JUST CLAIMED THIS TASK IS DONE. THEY ARE PROBABLY LYING.**\n\nSubagents say \"done\" when code has errors, tests pass trivially, logic is wrong,\nor they quietly added features nobody asked for. This happens EVERY TIME.\nAssume the work is broken until YOU prove otherwise.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (before running anything)**\n\nDo NOT run tests yet. Read the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed. Any file outside expected scope = scope creep.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file, critically ask:\n - Does this code ACTUALLY do what the task required? (Re-read the task, compare line by line)\n - Any stubs, TODOs, placeholders, hardcoded values? (`Grep` for TODO, FIXME, HACK, xxx)\n - Logic errors? Trace the happy path AND the error path in your head.\n - Anti-patterns? (`Grep` for `as any`, `@ts-ignore`, empty catch, console.log in changed files)\n - Scope creep? Did the subagent touch things or add features NOT in the task spec?\n4. Cross-check every claim:\n - Said \"Updated X\" - READ X. Actually updated, or just superficially touched?\n - Said \"Added tests\" - READ the tests. Do they test REAL behavior or just `expect(true).toBe(true)`?\n - Said \"Follows patterns\" - OPEN a reference file. Does it ACTUALLY match?\n\n**If you cannot explain what every changed line does, you have NOT reviewed it.**\n\n**PHASE 2: RUN AUTOMATED CHECKS (targeted, then broad)**\n\nNow that you understand the code, verify mechanically:\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors\n2. Run tests for changed modules FIRST, then full suite\n3. Build/typecheck - exit 0\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. The code has bugs that tests don't cover. Fix the code.\n\n**PHASE 3: HANDS-ON QA - ACTUALLY RUN IT (MANDATORY for user-facing changes)**\n\nTests and linters CANNOT catch: visual bugs, wrong CLI output, broken user flows, API response shape issues.\n\n**If this task produced anything a user would SEE or INTERACT with, you MUST launch it and verify yourself.**\n\n- **Frontend/UI**: `/playwright` skill - load the page, click through the flow, check console. Verify: page loads, interactions work, console clean, responsive.\n- **TUI/CLI**: `interactive_bash` - run the command, try good input, try bad input, try --help. Verify: command runs, output correct, error messages helpful, edge inputs handled.\n- **API/Backend**: `Bash` with curl - hit the endpoint, check response body, send malformed input. Verify: returns 200, body correct, error cases return proper errors.\n- **Config/Build**: Actually start the service or import the config. Verify: loads without error, backward compatible.\n\nThis is NOT optional \"if applicable\". If the deliverable is user-facing and you did not run it, you are shipping untested work.\n\n**PHASE 4: GATE DECISION - Should you proceed to the next task?**\n\nAnswer honestly:\n1. Can I explain what EVERY changed line does? (If no - back to Phase 1)\n2. Did I SEE it work with my own eyes? (If user-facing and no - back to Phase 3)\n3. Am I confident nothing existing is broken? (If no - run broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO. Investigate until CERTAIN.\n\n- **All 3 YES** - Proceed: mark task complete, move to next.\n- **Any NO** - Reject: resume session with `session_id`, fix the specific issue.\n- **Unsure** - Reject: \"unsure\" = \"no\". Investigate until you have a definitive answer.\n\n**DO NOT proceed to the next task until all 4 phases are complete and the gate passes.**";
|
|
4
5
|
export declare const VERIFICATION_REMINDER_GEMINI = "**THE SUBAGENT HAS FINISHED. THEIR WORK IS EXTREMELY SUSPICIOUS.**\n\nThe subagent CLAIMS this task is done. Based on thousands of executions, subagent claims are FALSE more often than true.\nThey ROUTINELY:\n- Ship code with syntax errors they didn't bother to check\n- Create stub implementations with TODOs and call it \"done\"\n- Write tests that pass trivially (testing nothing meaningful)\n- Implement logic that does NOT match what was requested\n- Add features nobody asked for and call it \"improvement\"\n- Report \"all tests pass\" when they didn't run any tests\n\n**This is NOT a theoretical warning. This WILL happen on this task. Assume the work is BROKEN.**\n\n**YOU MUST VERIFY WITH ACTUAL TOOL CALLS. NOT REASONING. TOOL CALLS.**\nThinking \"it looks correct\" is NOT verification. Running `lsp_diagnostics` IS.\n\n---\n\n**PHASE 1: READ THE CODE FIRST (DO NOT SKIP - DO NOT RUN TESTS YET)**\n\nRead the code FIRST so you know what you're testing.\n\n1. `Bash(\"git diff --stat -- ':!node_modules'\")` - see exactly which files changed.\n2. `Read` EVERY changed file - no exceptions, no skimming.\n3. For EACH file:\n - Does this code ACTUALLY do what the task required? RE-READ the task spec.\n - Any stubs, TODOs, placeholders? `Grep` for TODO, FIXME, HACK, xxx\n - Anti-patterns? `Grep` for `as any`, `@ts-ignore`, empty catch\n - Scope creep? Did the subagent add things NOT in the task spec?\n4. Cross-check EVERY claim against actual code.\n\n**If you cannot explain what every changed line does, GO BACK AND READ AGAIN.**\n\n**PHASE 2: RUN AUTOMATED CHECKS**\n\n1. `lsp_diagnostics` on EACH changed file - ZERO new errors. ACTUALLY RUN THIS.\n2. Run tests for changed modules, then full suite. ACTUALLY RUN THESE.\n3. Build/typecheck - exit 0.\n\nIf Phase 1 found issues but Phase 2 passes: Phase 2 is WRONG. Fix the code.\n\n**PHASE 3: HANDS-ON QA (MANDATORY for user-facing changes)**\n\n- **Frontend/UI**: `/playwright`\n- **TUI/CLI**: `interactive_bash`\n- **API/Backend**: `Bash` with curl\n\n**If user-facing and you did not run it, you are shipping UNTESTED BROKEN work.**\n\n**PHASE 4: GATE DECISION**\n\n1. Can I explain what EVERY changed line does? (If no \u2192 Phase 1)\n2. Did I SEE it work via tool calls? (If user-facing and no \u2192 Phase 3)\n3. Am I confident nothing is broken? (If no \u2192 broader tests)\n\nALL three must be YES. \"Probably\" = NO. \"I think so\" = NO.\n\n**DO NOT proceed to the next task until all 4 phases are complete.**";
|
|
5
6
|
export declare const ORCHESTRATOR_DELEGATION_REQUIRED: string;
|
|
@@ -5,6 +5,7 @@ export declare function createToolExecuteAfterHandler(input: {
|
|
|
5
5
|
ctx: PluginInput;
|
|
6
6
|
pendingFilePaths: Map<string, string>;
|
|
7
7
|
pendingTaskRefs: Map<string, PendingTaskRef>;
|
|
8
|
+
pendingPlanSnapshots?: Map<string, string>;
|
|
8
9
|
autoCommit: boolean;
|
|
9
10
|
getState: (sessionID: string) => SessionState;
|
|
10
11
|
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
@@ -4,6 +4,7 @@ export declare function createToolExecuteBeforeHandler(input: {
|
|
|
4
4
|
ctx: PluginInput;
|
|
5
5
|
pendingFilePaths: Map<string, string>;
|
|
6
6
|
pendingTaskRefs: Map<string, PendingTaskRef>;
|
|
7
|
+
pendingPlanSnapshots?: Map<string, string>;
|
|
7
8
|
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
8
9
|
}): (toolInput: {
|
|
9
10
|
tool: string;
|
|
@@ -16,6 +16,7 @@ export interface AtlasHookOptions {
|
|
|
16
16
|
isContinuationStopped?: (sessionID: string) => boolean;
|
|
17
17
|
isCallerOrchestrator?: (sessionID: string | undefined) => Promise<boolean>;
|
|
18
18
|
agentOverrides?: AgentOverrides;
|
|
19
|
+
idleSettleMs?: number;
|
|
19
20
|
/** Enable auto-commit after each atomic task completion (default: true) */
|
|
20
21
|
autoCommit?: boolean;
|
|
21
22
|
}
|
|
@@ -52,4 +53,5 @@ export interface SessionState {
|
|
|
52
53
|
waitingForFinalWaveApproval?: boolean;
|
|
53
54
|
pendingFinalWaveTaskCount?: number;
|
|
54
55
|
approvedFinalWaveTaskCount?: number;
|
|
56
|
+
boulderCompletionNudgedAt?: Record<string, number>;
|
|
55
57
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { CompactionContextClient } from "./types";
|
|
2
2
|
import type { TailMonitorState } from "./tail-monitor";
|
|
3
3
|
export declare function createRecoveryLogic(ctx: CompactionContextClient | undefined, getTailState: (sessionID: string) => TailMonitorState): {
|
|
4
|
-
recoverCheckpointedAgentConfig: (sessionID: string, reason: "session.compacted" | "no-text-tail") => Promise<boolean>;
|
|
4
|
+
recoverCheckpointedAgentConfig: (sessionID: string, reason: "compaction.autocontinue" | "session.compacted" | "no-text-tail") => Promise<boolean>;
|
|
5
5
|
maybeWarnAboutNoTextTail: (sessionID: string) => Promise<void>;
|
|
6
6
|
};
|
|
@@ -1,11 +1,22 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
type ToolExecuteBeforeInput = {
|
|
3
|
+
tool: string;
|
|
4
|
+
sessionID: string;
|
|
5
|
+
callID: string;
|
|
6
|
+
};
|
|
7
|
+
type ToolExecuteBeforeOutput = {
|
|
8
|
+
args: Record<string, unknown>;
|
|
9
|
+
};
|
|
2
10
|
export interface CompactionTodoPreserver {
|
|
3
11
|
capture: (sessionID: string) => Promise<void>;
|
|
12
|
+
restore: (sessionID: string) => Promise<void>;
|
|
4
13
|
event: (input: {
|
|
5
14
|
event: {
|
|
6
15
|
type: string;
|
|
7
16
|
properties?: unknown;
|
|
8
17
|
};
|
|
9
18
|
}) => Promise<void>;
|
|
19
|
+
"tool.execute.before": (input: ToolExecuteBeforeInput, output: ToolExecuteBeforeOutput) => Promise<void>;
|
|
10
20
|
}
|
|
11
21
|
export declare function createCompactionTodoPreserverHook(ctx: PluginInput): CompactionTodoPreserver;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type ToolExecuteInput = {
|
|
2
|
+
tool: string;
|
|
3
|
+
sessionID: string;
|
|
4
|
+
callID: string;
|
|
5
|
+
};
|
|
6
|
+
type ToolBeforeOutput = {
|
|
7
|
+
args: Record<string, unknown>;
|
|
8
|
+
};
|
|
9
|
+
type ToolAfterOutput = {
|
|
10
|
+
title: string;
|
|
11
|
+
output: string;
|
|
12
|
+
metadata: unknown;
|
|
13
|
+
};
|
|
14
|
+
export declare function createFsyncSkipWarningHook(): {
|
|
15
|
+
"tool.execute.before": (input: ToolExecuteInput, _output: ToolBeforeOutput) => Promise<void>;
|
|
16
|
+
"tool.execute.after": (input: ToolExecuteInput, output: ToolAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -55,3 +55,4 @@ export { createReadImageResizerHook } from "./read-image-resizer";
|
|
|
55
55
|
export { createTodoDescriptionOverrideHook } from "./todo-description-override";
|
|
56
56
|
export { createWebFetchRedirectGuardHook } from "./webfetch-redirect-guard";
|
|
57
57
|
export { createLegacyPluginToastHook } from "./legacy-plugin-toast";
|
|
58
|
+
export { createFsyncSkipWarningHook } from "./fsync-skip-warning";
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export type ContinuationPromptResult = {
|
|
3
|
+
status: "dispatched";
|
|
4
|
+
} | {
|
|
5
|
+
status: "rejected";
|
|
6
|
+
error: Error;
|
|
7
|
+
};
|
|
2
8
|
export declare function injectContinuationPrompt(ctx: PluginInput, options: {
|
|
3
9
|
sessionID: string;
|
|
4
10
|
prompt: string;
|
|
5
11
|
directory: string;
|
|
6
12
|
apiTimeoutMs: number;
|
|
7
13
|
inheritFromSessionID?: string;
|
|
8
|
-
}): Promise<
|
|
14
|
+
}): Promise<ContinuationPromptResult>;
|
|
@@ -8,5 +8,14 @@ type ContinuationOptions = {
|
|
|
8
8
|
setSessionID: (sessionID: string) => RalphLoopState | null;
|
|
9
9
|
};
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ContinuationResult = {
|
|
12
|
+
status: "dispatched";
|
|
13
|
+
sessionID: string;
|
|
14
|
+
} | {
|
|
15
|
+
status: "session_creation_rejected";
|
|
16
|
+
} | {
|
|
17
|
+
status: "dispatch_rejected";
|
|
18
|
+
error: unknown;
|
|
19
|
+
};
|
|
20
|
+
export declare function continueIteration(ctx: PluginInput, state: RalphLoopState, options: ContinuationOptions): Promise<ContinuationResult>;
|
|
12
21
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
|
1
|
+
import type { IterationCommitExpectation, RalphLoopOptions, RalphLoopState } from "./types";
|
|
2
2
|
export declare function createLoopStateController(options: {
|
|
3
3
|
directory: string;
|
|
4
4
|
stateDir: string | undefined;
|
|
@@ -14,10 +14,11 @@ export declare function createLoopStateController(options: {
|
|
|
14
14
|
cancelLoop(sessionID: string): boolean;
|
|
15
15
|
getState(): RalphLoopState | null;
|
|
16
16
|
clear(): boolean;
|
|
17
|
-
incrementIteration(): RalphLoopState | null;
|
|
17
|
+
incrementIteration(expected?: IterationCommitExpectation): RalphLoopState | null;
|
|
18
18
|
setSessionID(sessionID: string): RalphLoopState | null;
|
|
19
|
-
setMessageCountAtStart(sessionID: string, messageCountAtStart: number): RalphLoopState | null;
|
|
19
|
+
setMessageCountAtStart(sessionID: string, messageCountAtStart: number, expectedStartedAt?: string): RalphLoopState | null;
|
|
20
20
|
markVerificationPending(sessionID: string): RalphLoopState | null;
|
|
21
21
|
setVerificationSessionID(sessionID: string, verificationSessionID: string): RalphLoopState | null;
|
|
22
22
|
restartAfterFailedVerification(sessionID: string, messageCountAtStart?: number): RalphLoopState | null;
|
|
23
|
+
clearVerificationState(sessionID: string, messageCountAtStart?: number): RalphLoopState | null;
|
|
23
24
|
};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { RalphLoopState } from "./types";
|
|
3
|
+
import type { IterationCommitExpectation } from "./types";
|
|
3
4
|
type LoopStateController = {
|
|
4
5
|
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
6
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
7
|
+
incrementIteration: (expected?: IterationCommitExpectation) => RalphLoopState | null;
|
|
8
|
+
clear: () => boolean;
|
|
5
9
|
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
|
|
6
10
|
};
|
|
7
11
|
export declare function handlePendingVerification(ctx: PluginInput, input: {
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
|
2
|
+
import type { IterationCommitExpectation, RalphLoopOptions, RalphLoopState } from "./types";
|
|
3
3
|
type LoopStateController = {
|
|
4
4
|
getState: () => RalphLoopState | null;
|
|
5
5
|
clear: () => boolean;
|
|
6
|
-
incrementIteration: () => RalphLoopState | null;
|
|
6
|
+
incrementIteration: (expected?: IterationCommitExpectation) => RalphLoopState | null;
|
|
7
7
|
setSessionID: (sessionID: string) => RalphLoopState | null;
|
|
8
8
|
markVerificationPending: (sessionID: string) => RalphLoopState | null;
|
|
9
9
|
setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
|
|
10
10
|
restartAfterFailedVerification: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
11
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
11
12
|
};
|
|
12
13
|
type RalphLoopEventHandlerOptions = {
|
|
13
14
|
directory: string;
|
|
14
15
|
apiTimeoutMs: number;
|
|
16
|
+
idleSettleMs: number;
|
|
15
17
|
getTranscriptPath: (sessionID: string) => string | undefined;
|
|
16
18
|
checkSessionExists?: RalphLoopOptions["checkSessionExists"];
|
|
17
19
|
backgroundManager?: RalphLoopOptions["backgroundManager"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { RalphLoopState } from "./types";
|
|
1
|
+
import type { IterationCommitExpectation, RalphLoopState } from "./types";
|
|
2
2
|
export declare function getStateFilePath(directory: string, customPath?: string): string;
|
|
3
3
|
export declare function readState(directory: string, customPath?: string): RalphLoopState | null;
|
|
4
4
|
export declare function writeState(directory: string, state: RalphLoopState, customPath?: string): boolean;
|
|
5
5
|
export declare function clearState(directory: string, customPath?: string): boolean;
|
|
6
|
-
export declare function incrementIteration(directory: string, customPath?: string): RalphLoopState | null;
|
|
6
|
+
export declare function incrementIteration(directory: string, customPath?: string, expected?: IterationCommitExpectation): RalphLoopState | null;
|
|
@@ -15,10 +15,15 @@ export interface RalphLoopState {
|
|
|
15
15
|
verification_pending?: boolean;
|
|
16
16
|
strategy?: "reset" | "continue";
|
|
17
17
|
}
|
|
18
|
+
export interface IterationCommitExpectation {
|
|
19
|
+
iteration: number;
|
|
20
|
+
sessionID: string;
|
|
21
|
+
}
|
|
18
22
|
export interface RalphLoopOptions {
|
|
19
23
|
config?: RalphLoopConfig;
|
|
20
24
|
getTranscriptPath?: (sessionId: string) => string;
|
|
21
25
|
apiTimeout?: number;
|
|
26
|
+
idleSettleMs?: number;
|
|
22
27
|
checkSessionExists?: (sessionId: string) => Promise<boolean>;
|
|
23
28
|
backgroundManager?: {
|
|
24
29
|
getTasksByParentSession: (sessionId: string) => Array<{
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
-
import type { RalphLoopState } from "./types";
|
|
2
|
+
import type { IterationCommitExpectation, RalphLoopState } from "./types";
|
|
3
3
|
type LoopStateController = {
|
|
4
|
-
|
|
4
|
+
clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
|
|
5
|
+
incrementIteration: (expected?: IterationCommitExpectation) => RalphLoopState | null;
|
|
6
|
+
clear: () => boolean;
|
|
5
7
|
};
|
|
6
8
|
export declare function handleFailedVerification(ctx: PluginInput, input: {
|
|
7
9
|
state: RalphLoopState;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DEFAULT_SESSION_IDLE_SETTLE_MS = 150;
|
|
2
|
+
export declare function settleAfterSessionIdle(ms?: number): Promise<void>;
|
|
3
|
+
type SessionStatusClient = {
|
|
4
|
+
session?: {
|
|
5
|
+
status?: () => Promise<unknown>;
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
export declare function isActiveSessionStatusType(statusType: string): boolean;
|
|
9
|
+
export declare function isSessionActive(client: SessionStatusClient, sessionID: string): Promise<boolean>;
|
|
10
|
+
export declare function shouldPromptAfterSessionIdle(client: SessionStatusClient, sessionID: string, settleMs?: number): Promise<boolean>;
|
|
11
|
+
export {};
|
|
@@ -24,6 +24,7 @@ type TeamIdleWakeHintContext = {
|
|
|
24
24
|
client: {
|
|
25
25
|
session: {
|
|
26
26
|
promptAsync?: (input: PromptAsyncInput) => Promise<unknown>;
|
|
27
|
+
status?: () => Promise<unknown>;
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
};
|
|
@@ -34,5 +35,8 @@ type HookInput = {
|
|
|
34
35
|
};
|
|
35
36
|
};
|
|
36
37
|
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
37
|
-
|
|
38
|
+
type TeamIdleWakeHintOptions = {
|
|
39
|
+
idleSettleMs?: number;
|
|
40
|
+
};
|
|
41
|
+
export declare function createTeamIdleWakeHint(ctx: TeamIdleWakeHintContext, config: TeamModeConfig, options?: TeamIdleWakeHintOptions): HookImpl;
|
|
38
42
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const TODOWRITE_DESCRIPTION = "Use this tool to create and manage a structured task list for tracking progress on multi-step work.\n\n## Todo Format (MANDATORY)\n\nEach todo title MUST encode four elements: WHERE, WHY, HOW, and EXPECTED RESULT.\n\nFormat: \"[WHERE] [HOW] to [WHY] - expect [RESULT]\"\n\nGOOD:\n- \"src/utils/validation.ts: Add validateEmail() for input sanitization - returns boolean\"\n- \"UserService.create(): Call validateEmail() before DB insert - rejects invalid emails with 400\"\n- \"validation.test.ts: Add test for missing @ sign - expect validateEmail('foo') to return false\"\n\nBAD:\n- \"Implement email validation\" (where? how? what result?)\n- \"Add dark mode\" (feature, not a todo)\n- \"Fix auth\" (what file? what changes? what's expected?)\n\n## Granularity Rules\n\nEach todo MUST be a single atomic action completable in 1-3 tool calls. If it needs more, split it.\n\n**Size test**: Can you complete this todo by editing one file or running one command? If not, it's too big.\n\n## Task Management\n- One in_progress at a time. Complete it before starting the next.\n- Mark completed immediately after finishing each item.\n- Skip this tool for single trivial tasks (one-step, obvious action).";
|
|
1
|
+
export declare const TODOWRITE_DESCRIPTION = "Use this tool to create and manage a structured task list for tracking progress on multi-step work.\n\n## OpenCode Schema Contract\n\nThe upstream OpenCode `todowrite` schema expects each todo item to include:\n\n- `content`: string\n- `status`: string, one of `pending`, `in_progress`, `completed`, `cancelled`\n- `priority`: string, one of `high`, `medium`, `low`\n\n`priority` is a string field. Never send numeric priorities such as `0`, `1`, `2`, or labels such as `P0`, `P1`, `P2`.\n\n## Todo Format (MANDATORY)\n\nEach todo title MUST encode four elements: WHERE, WHY, HOW, and EXPECTED RESULT.\n\nFormat: \"[WHERE] [HOW] to [WHY] - expect [RESULT]\"\n\nGOOD:\n- \"src/utils/validation.ts: Add validateEmail() for input sanitization - returns boolean\"\n- \"UserService.create(): Call validateEmail() before DB insert - rejects invalid emails with 400\"\n- \"validation.test.ts: Add test for missing @ sign - expect validateEmail('foo') to return false\"\n\nBAD:\n- \"Implement email validation\" (where? how? what result?)\n- \"Add dark mode\" (feature, not a todo)\n- \"Fix auth\" (what file? what changes? what's expected?)\n\n## Granularity Rules\n\nEach todo MUST be a single atomic action completable in 1-3 tool calls. If it needs more, split it.\n\n**Size test**: Can you complete this todo by editing one file or running one command? If not, it's too big.\n\n## Task Management\n- One in_progress at a time. Complete it before starting the next.\n- Mark completed immediately after finishing each item.\n- Skip this tool for single trivial tasks (one-step, obvious action).";
|
|
@@ -55,12 +55,14 @@ type BabysitterContext = {
|
|
|
55
55
|
directory?: string;
|
|
56
56
|
};
|
|
57
57
|
}) => Promise<unknown>;
|
|
58
|
+
status?: () => Promise<unknown>;
|
|
58
59
|
};
|
|
59
60
|
};
|
|
60
61
|
};
|
|
61
62
|
type BabysitterOptions = {
|
|
62
63
|
backgroundManager: Pick<BackgroundManager, "getTasksByParentSession">;
|
|
63
64
|
config?: BabysittingConfig;
|
|
65
|
+
idleSettleMs?: number;
|
|
64
66
|
};
|
|
65
67
|
export declare function createUnstableAgentBabysitterHook(ctx: BabysitterContext, options: BabysitterOptions): {
|
|
66
68
|
event: ({ event }: {
|