oh-my-opencode 3.17.4 → 3.17.6
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 +3 -3
- package/README.ko.md +3 -3
- package/README.md +3 -3
- package/README.ru.md +3 -3
- package/README.zh-cn.md +3 -3
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-16.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-17.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-18.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-19.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/packages/pkg-one/src/file-20.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-01.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-02.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-03.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-04.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-05.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-06.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-07.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-08.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-09.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/app/file-10.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-11.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-12.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-13.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-14.d.ts +1 -0
- package/dist/__tests__/perf/fixtures/in-tree/src/lib/file-15.d.ts +1 -0
- package/dist/agents/agent-builder.d.ts +2 -3
- package/dist/agents/agent-skill-resolution.d.ts +7 -0
- package/dist/agents/atlas/default-prompt-sections.d.ts +2 -2
- package/dist/agents/atlas/gemini-prompt-sections.d.ts +1 -1
- package/dist/agents/atlas/gpt-prompt-sections.d.ts +1 -1
- package/dist/agents/frontier-tool-schema-guard.d.ts +3 -0
- package/dist/agents/hephaestus/agent.d.ts +1 -1
- package/dist/agents/hephaestus/gpt-5-5.d.ts +12 -0
- package/dist/agents/sisyphus/claude-opus-4-7.d.ts +20 -0
- package/dist/agents/sisyphus/gpt-5-5.d.ts +20 -0
- package/dist/agents/sisyphus/index.d.ts +5 -0
- package/dist/agents/sisyphus/kimi-k2-6.d.ts +32 -0
- package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
- package/dist/agents/sisyphus-junior/gpt-5-5.d.ts +14 -0
- package/dist/agents/sisyphus-junior/index.d.ts +2 -0
- package/dist/agents/sisyphus-junior/kimi-k2-6.d.ts +13 -0
- package/dist/agents/types.d.ts +17 -1
- package/dist/cli/doctor/checks/model-resolution.d.ts +4 -0
- package/dist/cli/index.js +17471 -15372
- package/dist/config/schema/background-task.d.ts +0 -1
- package/dist/config/schema/oh-my-opencode-config.d.ts +0 -1
- package/dist/create-hooks.d.ts +2 -0
- package/dist/create-managers.d.ts +2 -0
- package/dist/create-tools.d.ts +1 -1
- package/dist/features/background-agent/process-cleanup.test-helpers.d.ts +4 -0
- package/dist/features/background-agent/subagent-spawn-limits.d.ts +0 -7
- package/dist/features/claude-code-command-loader/loader-cache.d.ts +6 -0
- package/dist/features/claude-code-command-loader/loader.d.ts +2 -0
- package/dist/features/team-mode/index.d.ts +2 -0
- package/dist/features/team-mode/team-layout-tmux/index.d.ts +1 -0
- package/dist/features/team-mode/team-layout-tmux/layout.d.ts +15 -0
- package/dist/features/team-mode/team-worktree/cleanup.d.ts +3 -0
- package/dist/features/team-mode/team-worktree/index.d.ts +2 -0
- package/dist/features/team-mode/team-worktree/manager.d.ts +15 -0
- package/dist/features/team-mode/types.d.ts +210 -0
- package/dist/features/tmux-subagent/event-handlers.d.ts +0 -4
- package/dist/features/tmux-subagent/index.d.ts +0 -3
- package/dist/features/tmux-subagent/manager.d.ts +4 -0
- package/dist/features/tmux-subagent/polling-manager.d.ts +2 -1
- package/dist/hooks/auto-update-checker/hook/deferred-startup-check.d.ts +1 -0
- package/dist/hooks/comment-checker/initialization-gate.d.ts +1 -0
- package/dist/hooks/directory-agents-injector/finder.d.ts +1 -1
- package/dist/hooks/directory-readme-injector/finder.d.ts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/default.d.ts +1 -1
- package/dist/hooks/keyword-detector/ultrawork/gemini.d.ts +1 -1
- package/dist/hooks/model-fallback/controller-accessor.d.ts +8 -0
- package/dist/hooks/model-fallback/fallback-state-controller.d.ts +26 -0
- package/dist/hooks/model-fallback/hook.d.ts +21 -16
- package/dist/hooks/model-fallback/index.d.ts +2 -0
- package/dist/hooks/preemptive-compaction-trigger.d.ts +13 -0
- package/dist/hooks/preemptive-compaction-types.d.ts +53 -0
- package/dist/hooks/preemptive-compaction.d.ts +3 -15
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -6
- package/dist/hooks/ralph-loop/session-event-handler.d.ts +2 -6
- package/dist/hooks/ralph-loop/types.d.ts +5 -0
- package/dist/hooks/rules-injector/cache.d.ts +5 -0
- package/dist/hooks/rules-injector/injector.d.ts +2 -0
- package/dist/hooks/rules-injector/project-root-finder.d.ts +1 -0
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +2 -19
- package/dist/hooks/rules-injector/rule-scan-cache.d.ts +6 -0
- package/dist/hooks/session-notification-event-properties.d.ts +5 -0
- package/dist/hooks/session-notification-init.d.ts +7 -0
- package/dist/hooks/todo-continuation-enforcer/session-state.d.ts +1 -0
- package/dist/hooks/write-existing-file-guard/tool-execute-before-handler.d.ts +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +52209 -73179
- package/dist/oh-my-opencode.schema.json +0 -5
- package/dist/plugin/hooks/create-core-hooks.d.ts +4 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +4 -0
- package/dist/plugin/tool-registry.d.ts +1 -1
- package/dist/shared/agent-display-names.d.ts +7 -2
- package/dist/shared/agent-sort-shim.d.ts +28 -0
- package/dist/shared/excluded-dirs.d.ts +1 -0
- package/dist/shared/file-reference-resolver.d.ts +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/jsonc-parser.d.ts +8 -5
- package/dist/shared/load-opencode-plugins.d.ts +1 -0
- package/dist/shared/migration/migrations-sidecar.d.ts +1 -1
- package/dist/shared/model-capabilities/supplemental-entries.d.ts +2 -0
- package/dist/shared/permission-compat.d.ts +1 -1
- package/dist/shared/posthog-activity-state.d.ts +5 -2
- package/dist/shared/posthog.d.ts +5 -0
- package/dist/shared/project-discovery-dirs.d.ts +2 -0
- package/dist/shared/ripgrep-cli.d.ts +8 -0
- package/dist/shared/tmux/tmux-utils/index.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-kill.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/session-spawn.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/spawn-process.d.ts +1 -0
- package/dist/shared/tmux/tmux-utils/stale-session-sweep.d.ts +11 -0
- package/dist/shared/tmux/tmux-utils.d.ts +3 -1
- package/dist/tools/ast-grep/pattern-hints.d.ts +4 -0
- package/dist/tools/ast-grep/tool-descriptions.d.ts +3 -0
- package/dist/tools/call-omo-agent/sync-executor.d.ts +2 -3
- package/dist/tools/call-omo-agent/tools.d.ts +2 -1
- package/dist/tools/delegate-task/background-continuation.d.ts +1 -1
- package/dist/tools/delegate-task/executor-types.d.ts +2 -0
- package/dist/tools/delegate-task/resolve-metadata-model.d.ts +9 -0
- package/dist/tools/delegate-task/sync-continuation.d.ts +2 -2
- package/dist/tools/delegate-task/task-id.d.ts +2 -0
- package/dist/tools/delegate-task/tool-argument-preparation.d.ts +2 -0
- package/dist/tools/delegate-task/tool-description.d.ts +9 -0
- package/dist/tools/delegate-task/types.d.ts +4 -5
- package/dist/tools/glob/constants.d.ts +1 -1
- package/dist/tools/grep/cli.d.ts +1 -1
- package/dist/tools/grep/constants.d.ts +0 -8
- package/dist/tools/look-at/look-at-input-preparer.d.ts +22 -0
- package/dist/tools/look-at/look-at-prompt.d.ts +2 -0
- package/dist/tools/look-at/look-at-session-runner.d.ts +12 -0
- package/dist/tools/skill/description-formatter.d.ts +1 -1
- package/dist/tools/skill/session-skill-cache.d.ts +1 -0
- package/dist/tools/skill-mcp/parse-skill-mcp-arguments.d.ts +1 -0
- package/dist/tools/slashcommand/command-discovery-deps.d.ts +6 -0
- package/package.json +22 -18
- package/dist/features/tmux-subagent/cleanup.d.ts +0 -9
- package/dist/features/tmux-subagent/session-created-handler.d.ts +0 -22
- package/dist/features/tmux-subagent/session-deleted-handler.d.ts +0 -15
- package/dist/hooks/ralph-loop/loop-session-recovery.d.ts +0 -7
- package/dist/plugin-dispose.d.ts +0 -13
- /package/dist/{tools/delegate-task → shared}/model-string-parser.d.ts +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
2
|
+
import { getNextReachableFallback } from "./next-fallback";
|
|
3
|
+
type ModelFallbackStateLike = {
|
|
4
|
+
providerID: string;
|
|
5
|
+
modelID: string;
|
|
6
|
+
fallbackChain: FallbackEntry[];
|
|
7
|
+
attemptCount: number;
|
|
8
|
+
pending: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type ModelFallbackStateController = {
|
|
11
|
+
lastToastKey: Map<string, string>;
|
|
12
|
+
setSessionFallbackChain: (sessionID: string, fallbackChain: FallbackEntry[] | undefined) => void;
|
|
13
|
+
clearSessionFallbackChain: (sessionID: string) => void;
|
|
14
|
+
setPendingModelFallback: (sessionID: string, agentName: string, currentProviderID: string, currentModelID: string) => boolean;
|
|
15
|
+
getNextFallback: (sessionID: string) => ReturnType<typeof getNextReachableFallback>;
|
|
16
|
+
clearPendingModelFallback: (sessionID: string) => void;
|
|
17
|
+
hasPendingModelFallback: (sessionID: string) => boolean;
|
|
18
|
+
getFallbackState: (sessionID: string) => ModelFallbackStateLike | undefined;
|
|
19
|
+
reset: () => void;
|
|
20
|
+
};
|
|
21
|
+
export declare function createModelFallbackStateController(input: {
|
|
22
|
+
pendingModelFallbacks: Map<string, ModelFallbackStateLike>;
|
|
23
|
+
lastToastKey: Map<string, string>;
|
|
24
|
+
sessionFallbackChains: Map<string, FallbackEntry[]>;
|
|
25
|
+
}): ModelFallbackStateController;
|
|
26
|
+
export {};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
2
2
|
import type { ChatMessageInput, ChatMessageHandlerOutput } from "../../plugin/chat-message";
|
|
3
|
+
import { type ModelFallbackStateController } from "./fallback-state-controller";
|
|
4
|
+
import type { ModelFallbackControllerAccessor } from "./controller-accessor";
|
|
3
5
|
type FallbackToast = (input: {
|
|
4
6
|
title: string;
|
|
5
7
|
message: string;
|
|
@@ -19,18 +21,27 @@ export type ModelFallbackState = {
|
|
|
19
21
|
attemptCount: number;
|
|
20
22
|
pending: boolean;
|
|
21
23
|
};
|
|
22
|
-
|
|
23
|
-
export
|
|
24
|
+
type ModelFallbackControllerWithState = Pick<ModelFallbackStateController, "lastToastKey" | "setSessionFallbackChain" | "clearSessionFallbackChain" | "setPendingModelFallback" | "getNextFallback" | "clearPendingModelFallback" | "hasPendingModelFallback" | "getFallbackState" | "reset">;
|
|
25
|
+
export type ModelFallbackHook = ModelFallbackControllerWithState & {
|
|
26
|
+
"chat.message": (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
|
|
27
|
+
};
|
|
28
|
+
type ModelFallbackHookArgs = {
|
|
29
|
+
toast?: FallbackToast;
|
|
30
|
+
onApplied?: FallbackCallback;
|
|
31
|
+
controllerAccessor?: ModelFallbackControllerAccessor;
|
|
32
|
+
};
|
|
33
|
+
export declare function setSessionFallbackChain(controller: Pick<ModelFallbackStateController, "setSessionFallbackChain">, sessionID: string, fallbackChain: FallbackEntry[] | undefined): void;
|
|
34
|
+
export declare function clearSessionFallbackChain(controller: Pick<ModelFallbackStateController, "clearSessionFallbackChain">, sessionID: string): void;
|
|
24
35
|
/**
|
|
25
36
|
* Sets a pending model fallback for a session.
|
|
26
37
|
* Called when a model error is detected in session.error handler.
|
|
27
38
|
*/
|
|
28
|
-
export declare function setPendingModelFallback(sessionID: string, agentName: string, currentProviderID: string, currentModelID: string): boolean;
|
|
39
|
+
export declare function setPendingModelFallback(controller: Pick<ModelFallbackStateController, "setPendingModelFallback">, sessionID: string, agentName: string, currentProviderID: string, currentModelID: string): boolean;
|
|
29
40
|
/**
|
|
30
41
|
* Gets the next fallback model for a session.
|
|
31
42
|
* Increments attemptCount each time called.
|
|
32
43
|
*/
|
|
33
|
-
export declare function getNextFallback(sessionID: string): {
|
|
44
|
+
export declare function getNextFallback(controller: Pick<ModelFallbackStateController, "getNextFallback">, sessionID: string): {
|
|
34
45
|
providerID: string;
|
|
35
46
|
modelID: string;
|
|
36
47
|
variant?: string;
|
|
@@ -39,27 +50,21 @@ export declare function getNextFallback(sessionID: string): {
|
|
|
39
50
|
* Clears the pending fallback for a session.
|
|
40
51
|
* Called after fallback is successfully applied.
|
|
41
52
|
*/
|
|
42
|
-
export declare function clearPendingModelFallback(sessionID: string): void;
|
|
53
|
+
export declare function clearPendingModelFallback(controller: Pick<ModelFallbackStateController, "clearPendingModelFallback">, sessionID: string): void;
|
|
43
54
|
/**
|
|
44
55
|
* Checks if there's a pending fallback for a session.
|
|
45
56
|
*/
|
|
46
|
-
export declare function hasPendingModelFallback(sessionID: string): boolean;
|
|
57
|
+
export declare function hasPendingModelFallback(controller: Pick<ModelFallbackStateController, "hasPendingModelFallback">, sessionID: string): boolean;
|
|
47
58
|
/**
|
|
48
59
|
* Gets the current fallback state for a session (for debugging).
|
|
49
60
|
*/
|
|
50
|
-
export declare function getFallbackState(sessionID: string): ModelFallbackState | undefined;
|
|
61
|
+
export declare function getFallbackState(controller: Pick<ModelFallbackStateController, "getFallbackState">, sessionID: string): ModelFallbackState | undefined;
|
|
51
62
|
/**
|
|
52
63
|
* Creates a chat.message hook that applies model fallbacks when pending.
|
|
53
64
|
*/
|
|
54
|
-
export declare function createModelFallbackHook(args?:
|
|
55
|
-
toast?: FallbackToast;
|
|
56
|
-
onApplied?: FallbackCallback;
|
|
57
|
-
}): {
|
|
58
|
-
"chat.message": (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
|
|
59
|
-
};
|
|
65
|
+
export declare function createModelFallbackHook(args?: ModelFallbackHookArgs): ModelFallbackHook;
|
|
60
66
|
/**
|
|
61
|
-
* Resets
|
|
62
|
-
* Clears pending fallbacks, toast keys, and session chains.
|
|
67
|
+
* Resets hook-owned state for testing.
|
|
63
68
|
*/
|
|
64
|
-
export declare function _resetForTesting(): void;
|
|
69
|
+
export declare function _resetForTesting(controller?: Pick<ModelFallbackStateController, "reset">): void;
|
|
65
70
|
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
|
+
import { type ContextLimitModelCacheState } from "../shared/context-limit-resolver";
|
|
3
|
+
import type { CachedCompactionState, PreemptiveCompactionContext } from "./preemptive-compaction-types";
|
|
4
|
+
export declare function runPreemptiveCompactionIfNeeded(args: {
|
|
5
|
+
ctx: PreemptiveCompactionContext;
|
|
6
|
+
pluginConfig: OhMyOpenCodeConfig;
|
|
7
|
+
modelCacheState?: ContextLimitModelCacheState;
|
|
8
|
+
sessionID: string;
|
|
9
|
+
tokenCache: Map<string, CachedCompactionState>;
|
|
10
|
+
compactionInProgress: Set<string>;
|
|
11
|
+
compactedSessions: Set<string>;
|
|
12
|
+
lastCompactionTime: Map<string, number>;
|
|
13
|
+
}): Promise<void>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export interface TokenInfo {
|
|
2
|
+
input: number;
|
|
3
|
+
output: number;
|
|
4
|
+
reasoning: number;
|
|
5
|
+
cache: {
|
|
6
|
+
read: number;
|
|
7
|
+
write: number;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface CachedCompactionState {
|
|
11
|
+
providerID: string;
|
|
12
|
+
modelID: string;
|
|
13
|
+
tokens: TokenInfo;
|
|
14
|
+
}
|
|
15
|
+
export interface PreemptiveCompactionClient {
|
|
16
|
+
session: {
|
|
17
|
+
messages: (input: {
|
|
18
|
+
path: {
|
|
19
|
+
id: string;
|
|
20
|
+
};
|
|
21
|
+
query?: {
|
|
22
|
+
directory: string;
|
|
23
|
+
};
|
|
24
|
+
}) => Promise<unknown>;
|
|
25
|
+
summarize: (input: {
|
|
26
|
+
path: {
|
|
27
|
+
id: string;
|
|
28
|
+
};
|
|
29
|
+
body: {
|
|
30
|
+
providerID: string;
|
|
31
|
+
modelID: string;
|
|
32
|
+
auto?: boolean;
|
|
33
|
+
};
|
|
34
|
+
query: {
|
|
35
|
+
directory: string;
|
|
36
|
+
};
|
|
37
|
+
}) => Promise<unknown>;
|
|
38
|
+
};
|
|
39
|
+
tui: {
|
|
40
|
+
showToast: (input: {
|
|
41
|
+
body: {
|
|
42
|
+
title: string;
|
|
43
|
+
message: string;
|
|
44
|
+
variant: "warning";
|
|
45
|
+
duration: number;
|
|
46
|
+
};
|
|
47
|
+
}) => Promise<unknown>;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export interface PreemptiveCompactionContext {
|
|
51
|
+
client: PreemptiveCompactionClient;
|
|
52
|
+
directory: string;
|
|
53
|
+
}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
1
|
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
|
-
import {
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
session: {
|
|
6
|
-
messages: (...args: any[]) => any;
|
|
7
|
-
summarize: (...args: any[]) => any;
|
|
8
|
-
};
|
|
9
|
-
tui: {
|
|
10
|
-
showToast: (...args: any[]) => any;
|
|
11
|
-
};
|
|
12
|
-
};
|
|
13
|
-
directory: string;
|
|
14
|
-
};
|
|
15
|
-
export declare function createPreemptiveCompactionHook(ctx: PluginInput, pluginConfig: OhMyOpenCodeConfig, modelCacheState?: ContextLimitModelCacheState): {
|
|
2
|
+
import type { ContextLimitModelCacheState } from "../shared/context-limit-resolver";
|
|
3
|
+
import type { PreemptiveCompactionContext } from "./preemptive-compaction-types";
|
|
4
|
+
export declare function createPreemptiveCompactionHook(ctx: PreemptiveCompactionContext, pluginConfig: OhMyOpenCodeConfig, modelCacheState?: ContextLimitModelCacheState): {
|
|
16
5
|
"tool.execute.after": (input: {
|
|
17
6
|
tool: string;
|
|
18
7
|
sessionID: string;
|
|
@@ -29,4 +18,3 @@ export declare function createPreemptiveCompactionHook(ctx: PluginInput, pluginC
|
|
|
29
18
|
};
|
|
30
19
|
}) => Promise<void>;
|
|
31
20
|
};
|
|
32
|
-
export {};
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import type { RalphLoopOptions, RalphLoopState } from "./types";
|
|
3
|
-
type SessionRecovery = {
|
|
4
|
-
isRecovering: (sessionID: string) => boolean;
|
|
5
|
-
markRecovering: (sessionID: string) => void;
|
|
6
|
-
clear: (sessionID: string) => void;
|
|
7
|
-
};
|
|
8
3
|
type LoopStateController = {
|
|
9
4
|
getState: () => RalphLoopState | null;
|
|
10
5
|
clear: () => boolean;
|
|
@@ -19,7 +14,7 @@ type RalphLoopEventHandlerOptions = {
|
|
|
19
14
|
apiTimeoutMs: number;
|
|
20
15
|
getTranscriptPath: (sessionID: string) => string | undefined;
|
|
21
16
|
checkSessionExists?: RalphLoopOptions["checkSessionExists"];
|
|
22
|
-
|
|
17
|
+
backgroundManager?: RalphLoopOptions["backgroundManager"];
|
|
23
18
|
loopState: LoopStateController;
|
|
24
19
|
};
|
|
25
20
|
export declare function createRalphLoopEventHandler(ctx: PluginInput, options: RalphLoopEventHandlerOptions): ({ event }: {
|
|
@@ -3,10 +3,6 @@ type LoopStateController = {
|
|
|
3
3
|
getState: () => RalphLoopState | null;
|
|
4
4
|
clear: () => boolean;
|
|
5
5
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
markRecovering: (sessionID: string) => void;
|
|
9
|
-
};
|
|
10
|
-
export declare function handleDeletedLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController, sessionRecovery: SessionRecovery): boolean;
|
|
11
|
-
export declare function handleErroredLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController, sessionRecovery: SessionRecovery): boolean;
|
|
6
|
+
export declare function handleDeletedLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController): boolean;
|
|
7
|
+
export declare function handleErroredLoopSession(props: Record<string, unknown> | undefined, loopState: LoopStateController): boolean;
|
|
12
8
|
export {};
|
|
@@ -20,4 +20,9 @@ export interface RalphLoopOptions {
|
|
|
20
20
|
getTranscriptPath?: (sessionId: string) => string;
|
|
21
21
|
apiTimeout?: number;
|
|
22
22
|
checkSessionExists?: (sessionId: string) => Promise<boolean>;
|
|
23
|
+
backgroundManager?: {
|
|
24
|
+
getTasksByParentSession: (sessionId: string) => Array<{
|
|
25
|
+
status: string;
|
|
26
|
+
}>;
|
|
27
|
+
};
|
|
23
28
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { RuleScanCache } from "./rule-scan-cache";
|
|
1
2
|
export type SessionInjectedRulesCache = {
|
|
2
3
|
contentHashes: Set<string>;
|
|
3
4
|
realPaths: Set<string>;
|
|
@@ -6,3 +7,7 @@ export declare function createSessionCacheStore(): {
|
|
|
6
7
|
getSessionCache: (sessionID: string) => SessionInjectedRulesCache;
|
|
7
8
|
clearSessionCache: (sessionID: string) => void;
|
|
8
9
|
};
|
|
10
|
+
export declare function createSessionRuleScanCacheStore(): {
|
|
11
|
+
getSessionRuleScanCache: (sessionID: string) => RuleScanCache;
|
|
12
|
+
clearSessionRuleScanCache: (sessionID: string) => void;
|
|
13
|
+
};
|
|
@@ -4,6 +4,7 @@ import type { FindRuleFilesOptions } from "./rule-file-finder";
|
|
|
4
4
|
import { createContentHash, isDuplicateByContentHash, isDuplicateByRealPath, shouldApplyRule } from "./matcher";
|
|
5
5
|
import { saveInjectedRules } from "./storage";
|
|
6
6
|
import type { SessionInjectedRulesCache } from "./cache";
|
|
7
|
+
import type { RuleScanCache } from "./rule-scan-cache";
|
|
7
8
|
type ToolExecuteOutput = {
|
|
8
9
|
title: string;
|
|
9
10
|
output: string;
|
|
@@ -19,6 +20,7 @@ export declare function createRuleInjectionProcessor(deps: {
|
|
|
19
20
|
workspaceDirectory: string;
|
|
20
21
|
truncator: DynamicTruncator;
|
|
21
22
|
getSessionCache: (sessionID: string) => SessionInjectedRulesCache;
|
|
23
|
+
getSessionRuleScanCache?: (sessionID: string) => RuleScanCache;
|
|
22
24
|
ruleFinderOptions?: FindRuleFilesOptions;
|
|
23
25
|
readFileSync?: typeof readFileSync;
|
|
24
26
|
statSync?: typeof statSync;
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
+
import type { RuleScanCache } from "./rule-scan-cache";
|
|
1
2
|
import type { RuleFileCandidate } from "./types";
|
|
2
3
|
export interface FindRuleFilesOptions {
|
|
3
|
-
/**
|
|
4
|
-
* When true, skip loading rules from ~/.claude/rules/.
|
|
5
|
-
* Use when claude_code integration is disabled to prevent
|
|
6
|
-
* Claude Code-specific instructions from leaking into non-Claude agents.
|
|
7
|
-
*/
|
|
8
4
|
skipClaudeUserRules?: boolean;
|
|
9
5
|
}
|
|
10
|
-
|
|
11
|
-
* Find all rule files for a given context.
|
|
12
|
-
* Searches from currentFile upward to projectRoot for rule directories,
|
|
13
|
-
* then user-level directory (~/.claude/rules).
|
|
14
|
-
*
|
|
15
|
-
* IMPORTANT: This searches EVERY directory from file to project root.
|
|
16
|
-
* Not just the project root itself.
|
|
17
|
-
*
|
|
18
|
-
* @param projectRoot - Project root path (or null if outside any project)
|
|
19
|
-
* @param homeDir - User home directory
|
|
20
|
-
* @param currentFile - Current file being edited (for distance calculation)
|
|
21
|
-
* @returns Array of rule file candidates sorted by distance
|
|
22
|
-
*/
|
|
23
|
-
export declare function findRuleFiles(projectRoot: string | null, homeDir: string, currentFile: string, options?: FindRuleFilesOptions): RuleFileCandidate[];
|
|
6
|
+
export declare function findRuleFiles(projectRoot: string | null, homeDir: string, currentFile: string, options?: FindRuleFilesOptions, cache?: RuleScanCache): RuleFileCandidate[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
type EventProperties = Record<string, unknown> | undefined;
|
|
2
|
+
export declare function getSessionID(properties: EventProperties): string | undefined;
|
|
3
|
+
export declare function getEventToolName(properties: EventProperties): string | undefined;
|
|
4
|
+
export declare function getQuestionText(properties: EventProperties): string;
|
|
5
|
+
export {};
|
|
@@ -9,6 +9,7 @@ export interface ContinuationProgressUpdate {
|
|
|
9
9
|
export interface SessionStateStore {
|
|
10
10
|
getState: (sessionID: string) => SessionState;
|
|
11
11
|
getExistingState: (sessionID: string) => SessionState | undefined;
|
|
12
|
+
startPruneInterval: () => void;
|
|
12
13
|
recordActivity: (sessionID: string) => void;
|
|
13
14
|
trackContinuationProgress: (sessionID: string, incompleteCount: number, todos?: Todo[], options?: ContinuationProgressOptions) => ContinuationProgressUpdate;
|
|
14
15
|
resetContinuationProgress: (sessionID: string) => void;
|
|
@@ -10,6 +10,6 @@ export declare function handleWriteExistingFileGuardToolExecuteBefore(params: {
|
|
|
10
10
|
};
|
|
11
11
|
readPermissionsBySession: Map<string, Set<string>>;
|
|
12
12
|
sessionLastAccess: Map<string, number>;
|
|
13
|
-
|
|
13
|
+
getCanonicalSessionRoot: () => string;
|
|
14
14
|
maxTrackedSessions: number;
|
|
15
15
|
}): Promise<void>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
declare const
|
|
3
|
-
export default
|
|
1
|
+
import type { PluginModule } from "@opencode-ai/plugin";
|
|
2
|
+
declare const pluginModule: PluginModule;
|
|
3
|
+
export default pluginModule;
|
|
4
4
|
export type { OhMyOpenCodeConfig, AgentName, AgentOverrideConfig, AgentOverrides, McpName, HookName, BuiltinCommandName, } from "./config";
|
|
5
5
|
export type { ConfigLoadError } from "./shared/config-errors";
|