oh-my-opencode 4.1.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.
@@ -56,6 +56,8 @@ export declare class BackgroundManager {
56
56
  private completedTaskSummaries;
57
57
  private idleDeferralTimers;
58
58
  private notificationQueueByParent;
59
+ private pendingParentWakes;
60
+ private pendingParentWakeTimers;
59
61
  private observedOutputSessions;
60
62
  private observedIncompleteTodosBySession;
61
63
  private rootDescendantCounts;
@@ -170,6 +172,11 @@ export declare class BackgroundManager {
170
172
  */
171
173
  private tryCompleteTask;
172
174
  private notifyParentSession;
175
+ private isSessionActive;
176
+ private queuePendingParentWake;
177
+ private flushPendingParentWake;
178
+ private schedulePendingParentWakeFlush;
179
+ private clearPendingParentWakeTimer;
173
180
  private hasRunningTasks;
174
181
  private pruneStaleTasksAndNotifications;
175
182
  private checkAndInterruptStaleTasks;
@@ -1,6 +1,6 @@
1
1
  import type { PluginInput } from "@opencode-ai/plugin";
2
2
  import type { BackgroundTaskStatusProvider, SessionState } from "./types";
3
- export type BoulderContinuationResult = "injected" | "skipped_background_tasks" | "skipped_agent_unavailable" | "failed";
3
+ export type BoulderContinuationResult = "injected" | "skipped_active_session" | "skipped_background_tasks" | "skipped_agent_unavailable" | "failed";
4
4
  export declare function injectBoulderContinuation(input: {
5
5
  ctx: PluginInput;
6
6
  sessionID: string;
@@ -10,6 +10,7 @@ type ContinuationOptions = {
10
10
  };
11
11
  export type ContinuationResult = {
12
12
  status: "dispatched";
13
+ sessionID: string;
13
14
  } | {
14
15
  status: "session_creation_rejected";
15
16
  } | {
@@ -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,9 +14,9 @@ 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;
@@ -1,9 +1,10 @@
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;
5
6
  clearVerificationState: (sessionID: string, messageCountAtStart?: number) => RalphLoopState | null;
6
- incrementIteration: () => RalphLoopState | null;
7
+ incrementIteration: (expected?: IterationCommitExpectation) => RalphLoopState | null;
7
8
  clear: () => boolean;
8
9
  setVerificationSessionID: (sessionID: string, verificationSessionID: string) => RalphLoopState | null;
9
10
  };
@@ -1,9 +1,9 @@
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;
@@ -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,6 +15,10 @@ 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;
@@ -1,8 +1,8 @@
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: () => RalphLoopState | null;
5
+ incrementIteration: (expected?: IterationCommitExpectation) => RalphLoopState | null;
6
6
  clear: () => boolean;
7
7
  };
8
8
  export declare function handleFailedVerification(ctx: PluginInput, input: {
@@ -1,2 +1,11 @@
1
1
  export declare const DEFAULT_SESSION_IDLE_SETTLE_MS = 150;
2
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
  };
@@ -55,6 +55,7 @@ type BabysitterContext = {
55
55
  directory?: string;
56
56
  };
57
57
  }) => Promise<unknown>;
58
+ status?: () => Promise<unknown>;
58
59
  };
59
60
  };
60
61
  };