oh-my-opencode 3.6.0 → 3.7.1
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 +6 -6
- package/README.ko.md +6 -6
- package/README.md +6 -6
- package/README.zh-cn.md +6 -6
- package/dist/agents/sisyphus-junior/gpt.d.ts +4 -14
- package/dist/cli/index.js +357 -104
- package/dist/cli/run/event-handlers.d.ts +1 -0
- package/dist/cli/run/opencode-bin-path.d.ts +3 -0
- package/dist/cli/run/opencode-binary-resolver.d.ts +5 -0
- package/dist/cli/run/session-resolver.d.ts +1 -0
- package/dist/cli/run/types.d.ts +29 -0
- package/dist/config/schema/browser-automation.d.ts +2 -0
- package/dist/config/schema/experimental.d.ts +1 -0
- package/dist/config/schema/hooks.d.ts +1 -0
- package/dist/config/schema/oh-my-opencode-config.d.ts +3 -0
- package/dist/create-hooks.d.ts +3 -0
- package/dist/create-managers.d.ts +1 -0
- package/dist/features/background-agent/manager.d.ts +3 -0
- package/dist/features/builtin-skills/skills/index.d.ts +1 -0
- package/dist/features/builtin-skills/skills/playwright-cli.d.ts +10 -0
- package/dist/features/tmux-subagent/action-executor-core.d.ts +21 -0
- package/dist/features/tmux-subagent/action-executor.d.ts +3 -12
- package/dist/features/tmux-subagent/grid-planning.d.ts +2 -2
- package/dist/features/tmux-subagent/pane-split-availability.d.ts +3 -2
- package/dist/features/tmux-subagent/polling-manager.d.ts +1 -0
- package/dist/features/tmux-subagent/spawn-target-finder.d.ts +1 -1
- package/dist/hooks/context-window-monitor.d.ts +5 -1
- package/dist/hooks/directory-agents-injector/hook.d.ts +3 -1
- package/dist/hooks/directory-readme-injector/hook.d.ts +3 -1
- package/dist/hooks/hashline-read-enhancer/hook.d.ts +18 -0
- package/dist/hooks/hashline-read-enhancer/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/preemptive-compaction.d.ts +4 -1
- package/dist/hooks/rules-injector/hook.d.ts +3 -1
- package/dist/hooks/think-mode/switcher.d.ts +7 -0
- package/dist/hooks/tool-output-truncator.d.ts +3 -0
- package/dist/index.js +1758 -830
- package/dist/plugin/hooks/create-core-hooks.d.ts +3 -0
- package/dist/plugin/hooks/create-session-hooks.d.ts +2 -0
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +4 -1
- package/dist/shared/dynamic-truncator.d.ts +7 -3
- package/dist/shared/fallback-model-availability.d.ts +9 -2
- package/dist/shared/git-worktree/index.d.ts +2 -0
- package/dist/shared/git-worktree/parse-status-porcelain-line.d.ts +6 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/model-availability.d.ts +0 -5
- package/dist/shared/session-directory-resolver.d.ts +7 -0
- package/dist/shared/tmux/tmux-utils/layout.d.ts +2 -2
- package/dist/tools/call-omo-agent/tools.d.ts +1 -1
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +7 -1
- package/dist/tools/hashline-edit/constants.d.ts +2 -0
- package/dist/tools/hashline-edit/edit-operations.d.ts +6 -0
- package/dist/tools/hashline-edit/hash-computation.d.ts +3 -0
- package/dist/tools/hashline-edit/index.d.ts +7 -0
- package/dist/tools/hashline-edit/tools.d.ts +2 -0
- package/dist/tools/hashline-edit/types.d.ts +22 -0
- package/dist/tools/hashline-edit/validation.d.ts +6 -0
- package/dist/tools/index.d.ts +1 -0
- package/package.json +8 -8
- package/dist/features/background-agent/background-event-handler.d.ts +0 -26
- package/dist/features/background-agent/background-manager-shutdown.d.ts +0 -25
- package/dist/features/background-agent/notification-tracker.d.ts +0 -6
- package/dist/features/background-agent/notify-parent-session.d.ts +0 -10
- package/dist/features/background-agent/poll-running-tasks.d.ts +0 -15
- package/dist/features/background-agent/process-signal.d.ts +0 -2
- package/dist/features/background-agent/session-validator.d.ts +0 -7
- package/dist/features/background-agent/spawner/task-factory.d.ts +0 -2
- package/dist/features/background-agent/spawner/task-resumer.d.ts +0 -3
- package/dist/features/background-agent/spawner/task-starter.d.ts +0 -3
- package/dist/features/background-agent/stale-task-pruner.d.ts +0 -15
- package/dist/features/background-agent/task-canceller.d.ts +0 -27
- package/dist/features/background-agent/task-completer.d.ts +0 -13
- package/dist/features/background-agent/task-launch.d.ts +0 -15
- package/dist/features/background-agent/task-queries.d.ts +0 -7
- package/dist/features/background-agent/task-queue-processor.d.ts +0 -14
- package/dist/features/background-agent/task-resumer.d.ts +0 -14
- package/dist/features/background-agent/task-starter.d.ts +0 -27
- package/dist/features/background-agent/task-tracker.d.ts +0 -18
- package/dist/features/tmux-subagent/manager-cleanup.d.ts +0 -12
- package/dist/features/tmux-subagent/session-cleaner.d.ts +0 -23
- package/dist/features/tmux-subagent/session-spawner.d.ts +0 -34
- package/dist/hooks/interactive-bash-session/interactive-bash-session-hook.d.ts +0 -23
- package/dist/shared/available-models-fetcher.d.ts +0 -4
- package/dist/shared/model-cache-availability.d.ts +0 -2
- package/dist/tools/background-task/modules/background-cancel.d.ts +0 -4
- package/dist/tools/background-task/modules/background-output.d.ts +0 -3
- package/dist/tools/background-task/modules/background-task.d.ts +0 -3
- package/dist/tools/background-task/modules/formatters.d.ts +0 -11
- package/dist/tools/background-task/modules/message-processing.d.ts +0 -59
- package/dist/tools/background-task/modules/utils.d.ts +0 -16
- package/dist/tools/call-omo-agent/agent-type-normalizer.d.ts +0 -2
- package/dist/tools/call-omo-agent/sync-agent-executor.d.ts +0 -4
- package/dist/tools/delegate-task/skill-content-resolver.d.ts +0 -9
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { HookName, OhMyOpenCodeConfig } from "../../config";
|
|
2
2
|
import type { PluginContext } from "../types";
|
|
3
|
+
import type { ModelCacheState } from "../../plugin-state";
|
|
3
4
|
export declare function createCoreHooks(args: {
|
|
4
5
|
ctx: PluginContext;
|
|
5
6
|
pluginConfig: OhMyOpenCodeConfig;
|
|
7
|
+
modelCacheState: ModelCacheState;
|
|
6
8
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
7
9
|
safeHookEnabled: boolean;
|
|
8
10
|
}): {
|
|
@@ -18,6 +20,7 @@ export declare function createCoreHooks(args: {
|
|
|
18
20
|
rulesInjector: ReturnType<typeof import("../../hooks").createRulesInjectorHook> | null;
|
|
19
21
|
tasksTodowriteDisabler: ReturnType<typeof import("../../hooks").createTasksTodowriteDisablerHook> | null;
|
|
20
22
|
writeExistingFileGuard: ReturnType<typeof import("../../hooks").createWriteExistingFileGuardHook> | null;
|
|
23
|
+
hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
|
|
21
24
|
contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
|
|
22
25
|
preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
|
|
23
26
|
sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { OhMyOpenCodeConfig, HookName } from "../../config";
|
|
2
|
+
import type { ModelCacheState } from "../../plugin-state";
|
|
2
3
|
import type { PluginContext } from "../types";
|
|
3
4
|
import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createPrometheusMdOnlyHook, createSisyphusJuniorNotepadHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook } from "../../hooks";
|
|
4
5
|
import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
|
|
@@ -26,6 +27,7 @@ export type SessionHooks = {
|
|
|
26
27
|
export declare function createSessionHooks(args: {
|
|
27
28
|
ctx: PluginContext;
|
|
28
29
|
pluginConfig: OhMyOpenCodeConfig;
|
|
30
|
+
modelCacheState: ModelCacheState;
|
|
29
31
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
30
32
|
safeHookEnabled: boolean;
|
|
31
33
|
}): SessionHooks;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { HookName, OhMyOpenCodeConfig } from "../../config";
|
|
2
|
+
import type { ModelCacheState } from "../../plugin-state";
|
|
2
3
|
import type { PluginContext } from "../types";
|
|
3
|
-
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook } from "../../hooks";
|
|
4
|
+
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook } from "../../hooks";
|
|
4
5
|
export type ToolGuardHooks = {
|
|
5
6
|
commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
|
|
6
7
|
toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
|
|
@@ -10,10 +11,12 @@ export type ToolGuardHooks = {
|
|
|
10
11
|
rulesInjector: ReturnType<typeof createRulesInjectorHook> | null;
|
|
11
12
|
tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null;
|
|
12
13
|
writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null;
|
|
14
|
+
hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
|
|
13
15
|
};
|
|
14
16
|
export declare function createToolGuardHooks(args: {
|
|
15
17
|
ctx: PluginContext;
|
|
16
18
|
pluginConfig: OhMyOpenCodeConfig;
|
|
19
|
+
modelCacheState: ModelCacheState;
|
|
17
20
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
18
21
|
safeHookEnabled: boolean;
|
|
19
22
|
}): ToolGuardHooks;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
type ModelCacheStateLike = {
|
|
3
|
+
anthropicContext1MEnabled: boolean;
|
|
4
|
+
};
|
|
2
5
|
export interface TruncationResult {
|
|
3
6
|
result: string;
|
|
4
7
|
truncated: boolean;
|
|
@@ -10,13 +13,13 @@ export interface TruncationOptions {
|
|
|
10
13
|
contextWindowLimit?: number;
|
|
11
14
|
}
|
|
12
15
|
export declare function truncateToTokenLimit(output: string, maxTokens: number, preserveHeaderLines?: number): TruncationResult;
|
|
13
|
-
export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string): Promise<{
|
|
16
|
+
export declare function getContextWindowUsage(ctx: PluginInput, sessionID: string, modelCacheState?: ModelCacheStateLike): Promise<{
|
|
14
17
|
usedTokens: number;
|
|
15
18
|
remainingTokens: number;
|
|
16
19
|
usagePercentage: number;
|
|
17
20
|
} | null>;
|
|
18
|
-
export declare function dynamicTruncate(ctx: PluginInput, sessionID: string, output: string, options?: TruncationOptions): Promise<TruncationResult>;
|
|
19
|
-
export declare function createDynamicTruncator(ctx: PluginInput): {
|
|
21
|
+
export declare function dynamicTruncate(ctx: PluginInput, sessionID: string, output: string, options?: TruncationOptions, modelCacheState?: ModelCacheStateLike): Promise<TruncationResult>;
|
|
22
|
+
export declare function createDynamicTruncator(ctx: PluginInput, modelCacheState?: ModelCacheStateLike): {
|
|
20
23
|
truncate: (sessionID: string, output: string, options?: TruncationOptions) => Promise<TruncationResult>;
|
|
21
24
|
getUsage: (sessionID: string) => Promise<{
|
|
22
25
|
usedTokens: number;
|
|
@@ -25,3 +28,4 @@ export declare function createDynamicTruncator(ctx: PluginInput): {
|
|
|
25
28
|
} | null>;
|
|
26
29
|
truncateSync: (output: string, maxTokens: number, preserveHeaderLines?: number) => TruncationResult;
|
|
27
30
|
};
|
|
31
|
+
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
type FallbackEntry = {
|
|
2
2
|
providers: string[];
|
|
3
3
|
model: string;
|
|
4
|
-
}
|
|
4
|
+
};
|
|
5
|
+
type ResolvedFallbackModel = {
|
|
6
|
+
provider: string;
|
|
7
|
+
model: string;
|
|
8
|
+
};
|
|
9
|
+
export declare function resolveFirstAvailableFallback(fallbackChain: FallbackEntry[], availableModels: Set<string>): ResolvedFallbackModel | null;
|
|
10
|
+
export declare function isAnyFallbackModelAvailable(fallbackChain: FallbackEntry[], availableModels: Set<string>): boolean;
|
|
5
11
|
export declare function isAnyProviderConnected(providers: string[], availableModels: Set<string>): boolean;
|
|
12
|
+
export {};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export type { GitFileStatus, GitFileStat } from "./types";
|
|
2
|
+
export type { ParsedGitStatusPorcelainLine } from "./parse-status-porcelain-line";
|
|
3
|
+
export { parseGitStatusPorcelainLine } from "./parse-status-porcelain-line";
|
|
2
4
|
export { parseGitStatusPorcelain } from "./parse-status-porcelain";
|
|
3
5
|
export { parseGitDiffNumstat } from "./parse-diff-numstat";
|
|
4
6
|
export { collectGitDiffStats } from "./collect-git-diff-stats";
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ export * from "./model-resolver";
|
|
|
33
33
|
export { resolveModelPipeline } from "./model-resolution-pipeline";
|
|
34
34
|
export type { ModelResolutionRequest, ModelResolutionProvenance, ModelResolutionResult, } from "./model-resolution-types";
|
|
35
35
|
export * from "./model-availability";
|
|
36
|
+
export * from "./fallback-model-availability";
|
|
36
37
|
export * from "./connected-providers-cache";
|
|
37
38
|
export * from "./session-utils";
|
|
38
39
|
export * from "./tmux";
|
|
@@ -46,3 +47,4 @@ export * from "./truncate-description";
|
|
|
46
47
|
export * from "./opencode-storage-paths";
|
|
47
48
|
export * from "./opencode-message-dir";
|
|
48
49
|
export * from "./normalize-sdk-response";
|
|
50
|
+
export * from "./session-directory-resolver";
|
|
@@ -11,10 +11,5 @@ export declare function getConnectedProviders(client: any): Promise<string[]>;
|
|
|
11
11
|
export declare function fetchAvailableModels(client?: any, options?: {
|
|
12
12
|
connectedProviders?: string[] | null;
|
|
13
13
|
}): Promise<Set<string>>;
|
|
14
|
-
export declare function isAnyFallbackModelAvailable(fallbackChain: Array<{
|
|
15
|
-
providers: string[];
|
|
16
|
-
model: string;
|
|
17
|
-
}>, availableModels: Set<string>): boolean;
|
|
18
|
-
export declare function isAnyProviderConnected(providers: string[], availableModels: Set<string>): boolean;
|
|
19
14
|
export declare function __resetModelCache(): void;
|
|
20
15
|
export declare function isModelCacheAvailable(): boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function isWindowsAppDataDirectory(directory: string): boolean;
|
|
2
|
+
export declare function resolveSessionDirectory(options: {
|
|
3
|
+
parentDirectory: string | null | undefined;
|
|
4
|
+
fallbackDirectory: string;
|
|
5
|
+
platform?: NodeJS.Platform;
|
|
6
|
+
currentWorkingDirectory?: string;
|
|
7
|
+
}): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { TmuxLayout } from "../../../config/schema";
|
|
2
|
-
export declare function applyLayout(
|
|
3
|
-
export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number): Promise<void>;
|
|
2
|
+
export declare function applyLayout(layout: TmuxLayout, mainPaneSize: number): Promise<void>;
|
|
3
|
+
export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number, mainPaneSize: number): Promise<void>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { BackgroundManager } from "../../features/background-agent";
|
|
3
|
-
export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager): ToolDefinition;
|
|
3
|
+
export declare function createCallOmoAgent(ctx: PluginInput, backgroundManager: BackgroundManager, disabledAgents?: string[]): ToolDefinition;
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import type { DelegateTaskArgs, OpencodeClient } from "./types";
|
|
2
|
+
import { promptSyncWithModelSuggestionRetry, promptWithModelSuggestionRetry } from "../../shared/model-suggestion-retry";
|
|
3
|
+
type SendSyncPromptDeps = {
|
|
4
|
+
promptWithModelSuggestionRetry: typeof promptWithModelSuggestionRetry;
|
|
5
|
+
promptSyncWithModelSuggestionRetry: typeof promptSyncWithModelSuggestionRetry;
|
|
6
|
+
};
|
|
2
7
|
export declare function sendSyncPrompt(client: OpencodeClient, input: {
|
|
3
8
|
sessionID: string;
|
|
4
9
|
agentToUse: string;
|
|
@@ -13,4 +18,5 @@ export declare function sendSyncPrompt(client: OpencodeClient, input: {
|
|
|
13
18
|
removeTask: (id: string) => void;
|
|
14
19
|
} | null | undefined;
|
|
15
20
|
taskId: string | undefined;
|
|
16
|
-
}): Promise<string | null>;
|
|
21
|
+
}, deps?: SendSyncPromptDeps): Promise<string | null>;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export declare const HASH_DICT: readonly ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
2
|
+
export declare const HASHLINE_PATTERN: RegExp;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HashlineEdit } from "./types";
|
|
2
|
+
export declare function applySetLine(lines: string[], anchor: string, newText: string): string[];
|
|
3
|
+
export declare function applyReplaceLines(lines: string[], startAnchor: string, endAnchor: string, newText: string): string[];
|
|
4
|
+
export declare function applyInsertAfter(lines: string[], anchor: string, text: string): string[];
|
|
5
|
+
export declare function applyReplace(content: string, oldText: string, newText: string): string;
|
|
6
|
+
export declare function applyHashlineEdits(content: string, edits: HashlineEdit[]): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { computeLineHash, formatHashLine, formatHashLines } from "./hash-computation";
|
|
2
|
+
export { parseLineRef, validateLineRef } from "./validation";
|
|
3
|
+
export type { LineRef } from "./validation";
|
|
4
|
+
export type { SetLine, ReplaceLines, InsertAfter, Replace, HashlineEdit } from "./types";
|
|
5
|
+
export { HASH_DICT, HASHLINE_PATTERN } from "./constants";
|
|
6
|
+
export { applyHashlineEdits, applyInsertAfter, applyReplace, applyReplaceLines, applySetLine, } from "./edit-operations";
|
|
7
|
+
export { createHashlineEditTool } from "./tools";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface SetLine {
|
|
2
|
+
type: "set_line";
|
|
3
|
+
line: string;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ReplaceLines {
|
|
7
|
+
type: "replace_lines";
|
|
8
|
+
start_line: string;
|
|
9
|
+
end_line: string;
|
|
10
|
+
text: string;
|
|
11
|
+
}
|
|
12
|
+
export interface InsertAfter {
|
|
13
|
+
type: "insert_after";
|
|
14
|
+
line: string;
|
|
15
|
+
text: string;
|
|
16
|
+
}
|
|
17
|
+
export interface Replace {
|
|
18
|
+
type: "replace";
|
|
19
|
+
old_text: string;
|
|
20
|
+
new_text: string;
|
|
21
|
+
}
|
|
22
|
+
export type HashlineEdit = SetLine | ReplaceLines | InsertAfter | Replace;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -16,5 +16,6 @@ export { createCallOmoAgent } from "./call-omo-agent";
|
|
|
16
16
|
export { createLookAt } from "./look-at";
|
|
17
17
|
export { createDelegateTask } from "./delegate-task";
|
|
18
18
|
export { createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, } from "./task";
|
|
19
|
+
export { createHashlineEditTool } from "./hashline-edit";
|
|
19
20
|
export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
|
|
20
21
|
export declare const builtinTools: Record<string, ToolDefinition>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.1",
|
|
4
4
|
"description": "The Best AI Agent Harness - Batteries-Included OpenCode Plugin with Multi-Model Orchestration, Parallel Background Agents, and Crafted LSP/AST Tools",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"typescript": "^5.7.3"
|
|
75
75
|
},
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
78
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
79
|
-
"oh-my-opencode-linux-arm64": "3.
|
|
80
|
-
"oh-my-opencode-linux-arm64-musl": "3.
|
|
81
|
-
"oh-my-opencode-linux-x64": "3.
|
|
82
|
-
"oh-my-opencode-linux-x64-musl": "3.
|
|
83
|
-
"oh-my-opencode-windows-x64": "3.
|
|
77
|
+
"oh-my-opencode-darwin-arm64": "3.7.1",
|
|
78
|
+
"oh-my-opencode-darwin-x64": "3.7.1",
|
|
79
|
+
"oh-my-opencode-linux-arm64": "3.7.1",
|
|
80
|
+
"oh-my-opencode-linux-arm64-musl": "3.7.1",
|
|
81
|
+
"oh-my-opencode-linux-x64": "3.7.1",
|
|
82
|
+
"oh-my-opencode-linux-x64-musl": "3.7.1",
|
|
83
|
+
"oh-my-opencode-windows-x64": "3.7.1"
|
|
84
84
|
},
|
|
85
85
|
"trustedDependencies": [
|
|
86
86
|
"@ast-grep/cli",
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
type Event = {
|
|
3
|
-
type: string;
|
|
4
|
-
properties?: Record<string, unknown>;
|
|
5
|
-
};
|
|
6
|
-
export declare function handleBackgroundEvent(args: {
|
|
7
|
-
event: Event;
|
|
8
|
-
findBySession: (sessionID: string) => BackgroundTask | undefined;
|
|
9
|
-
getAllDescendantTasks: (sessionID: string) => BackgroundTask[];
|
|
10
|
-
releaseConcurrencyKey?: (key: string) => void;
|
|
11
|
-
cancelTask: (taskId: string, options: {
|
|
12
|
-
source: string;
|
|
13
|
-
reason: string;
|
|
14
|
-
skipNotification: true;
|
|
15
|
-
}) => Promise<boolean>;
|
|
16
|
-
tryCompleteTask: (task: BackgroundTask, source: string) => Promise<boolean>;
|
|
17
|
-
validateSessionHasOutput: (sessionID: string) => Promise<boolean>;
|
|
18
|
-
checkSessionTodos: (sessionID: string) => Promise<boolean>;
|
|
19
|
-
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
20
|
-
completionTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
21
|
-
tasks: Map<string, BackgroundTask>;
|
|
22
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
23
|
-
clearNotificationsForTask: (taskId: string) => void;
|
|
24
|
-
emitIdleEvent: (sessionID: string) => void;
|
|
25
|
-
}): void;
|
|
26
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask, LaunchInput } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
import type { PluginInput } from "@opencode-ai/plugin";
|
|
4
|
-
type QueueItem = {
|
|
5
|
-
task: BackgroundTask;
|
|
6
|
-
input: LaunchInput;
|
|
7
|
-
};
|
|
8
|
-
export declare function shutdownBackgroundManager(args: {
|
|
9
|
-
shutdownTriggered: {
|
|
10
|
-
value: boolean;
|
|
11
|
-
};
|
|
12
|
-
stopPolling: () => void;
|
|
13
|
-
tasks: Map<string, BackgroundTask>;
|
|
14
|
-
client: PluginInput["client"];
|
|
15
|
-
onShutdown?: () => void;
|
|
16
|
-
concurrencyManager: ConcurrencyManager;
|
|
17
|
-
completionTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
18
|
-
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
19
|
-
notifications: Map<string, BackgroundTask[]>;
|
|
20
|
-
pendingByParent: Map<string, Set<string>>;
|
|
21
|
-
queuesByKey: Map<string, QueueItem[]>;
|
|
22
|
-
processingKeys: Set<string>;
|
|
23
|
-
unregisterProcessCleanup: () => void;
|
|
24
|
-
}): void;
|
|
25
|
-
export {};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
export declare function markForNotification(notifications: Map<string, BackgroundTask[]>, task: BackgroundTask): void;
|
|
3
|
-
export declare function getPendingNotifications(notifications: Map<string, BackgroundTask[]>, sessionID: string): BackgroundTask[];
|
|
4
|
-
export declare function clearNotifications(notifications: Map<string, BackgroundTask[]>, sessionID: string): void;
|
|
5
|
-
export declare function clearNotificationsForTask(notifications: Map<string, BackgroundTask[]>, taskId: string): void;
|
|
6
|
-
export declare function cleanupPendingByParent(pendingByParent: Map<string, Set<string>>, task: BackgroundTask): void;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
3
|
-
export declare function notifyParentSession(args: {
|
|
4
|
-
task: BackgroundTask;
|
|
5
|
-
tasks: Map<string, BackgroundTask>;
|
|
6
|
-
pendingByParent: Map<string, Set<string>>;
|
|
7
|
-
completionTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
8
|
-
clearNotificationsForTask: (taskId: string) => void;
|
|
9
|
-
client: OpencodeClient;
|
|
10
|
-
}): Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
3
|
-
export declare function pollRunningTasks(args: {
|
|
4
|
-
tasks: Iterable<BackgroundTask>;
|
|
5
|
-
client: OpencodeClient;
|
|
6
|
-
pruneStaleTasksAndNotifications: () => void;
|
|
7
|
-
checkAndInterruptStaleTasks: (statuses: Record<string, {
|
|
8
|
-
type: string;
|
|
9
|
-
}>) => Promise<void>;
|
|
10
|
-
validateSessionHasOutput: (sessionID: string) => Promise<boolean>;
|
|
11
|
-
checkSessionTodos: (sessionID: string) => Promise<boolean>;
|
|
12
|
-
tryCompleteTask: (task: BackgroundTask, source: string) => Promise<boolean>;
|
|
13
|
-
hasRunningTasks: () => boolean;
|
|
14
|
-
stopPolling: () => void;
|
|
15
|
-
}): Promise<void>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
2
|
-
/**
|
|
3
|
-
* Validates that a session has actual assistant/tool output before marking complete.
|
|
4
|
-
* Prevents premature completion when session.idle fires before agent responds.
|
|
5
|
-
*/
|
|
6
|
-
export declare function validateSessionHasOutput(client: OpencodeClient, sessionID: string): Promise<boolean>;
|
|
7
|
-
export declare function checkSessionTodos(client: OpencodeClient, sessionID: string): Promise<boolean>;
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask, ResumeInput } from "../types";
|
|
2
|
-
import type { SpawnerContext } from "./spawner-context";
|
|
3
|
-
export declare function resumeTask(task: BackgroundTask, input: ResumeInput, ctx: Pick<SpawnerContext, "client" | "concurrencyManager" | "onTaskError">): Promise<void>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask, LaunchInput } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
type QueueItem = {
|
|
4
|
-
task: BackgroundTask;
|
|
5
|
-
input: LaunchInput;
|
|
6
|
-
};
|
|
7
|
-
export declare function pruneStaleState(args: {
|
|
8
|
-
tasks: Map<string, BackgroundTask>;
|
|
9
|
-
notifications: Map<string, BackgroundTask[]>;
|
|
10
|
-
queuesByKey: Map<string, QueueItem[]>;
|
|
11
|
-
concurrencyManager: ConcurrencyManager;
|
|
12
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
13
|
-
clearNotificationsForTask: (taskId: string) => void;
|
|
14
|
-
}): void;
|
|
15
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { LaunchInput } from "./types";
|
|
3
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
4
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
5
|
-
type QueueItem = {
|
|
6
|
-
task: BackgroundTask;
|
|
7
|
-
input: LaunchInput;
|
|
8
|
-
};
|
|
9
|
-
export declare function cancelBackgroundTask(args: {
|
|
10
|
-
taskId: string;
|
|
11
|
-
options?: {
|
|
12
|
-
source?: string;
|
|
13
|
-
reason?: string;
|
|
14
|
-
abortSession?: boolean;
|
|
15
|
-
skipNotification?: boolean;
|
|
16
|
-
};
|
|
17
|
-
tasks: Map<string, BackgroundTask>;
|
|
18
|
-
queuesByKey: Map<string, QueueItem[]>;
|
|
19
|
-
completionTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
20
|
-
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
21
|
-
concurrencyManager: ConcurrencyManager;
|
|
22
|
-
client: OpencodeClient;
|
|
23
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
24
|
-
markForNotification: (task: BackgroundTask) => void;
|
|
25
|
-
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
26
|
-
}): Promise<boolean>;
|
|
27
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
4
|
-
export declare function tryCompleteBackgroundTask(args: {
|
|
5
|
-
task: BackgroundTask;
|
|
6
|
-
source: string;
|
|
7
|
-
concurrencyManager: ConcurrencyManager;
|
|
8
|
-
idleDeferralTimers: Map<string, ReturnType<typeof setTimeout>>;
|
|
9
|
-
client: OpencodeClient;
|
|
10
|
-
markForNotification: (task: BackgroundTask) => void;
|
|
11
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
12
|
-
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
13
|
-
}): Promise<boolean>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { LaunchInput } from "./types";
|
|
3
|
-
type QueueItem = {
|
|
4
|
-
task: BackgroundTask;
|
|
5
|
-
input: LaunchInput;
|
|
6
|
-
};
|
|
7
|
-
export declare function launchBackgroundTask(args: {
|
|
8
|
-
input: LaunchInput;
|
|
9
|
-
tasks: Map<string, BackgroundTask>;
|
|
10
|
-
pendingByParent: Map<string, Set<string>>;
|
|
11
|
-
queuesByKey: Map<string, QueueItem[]>;
|
|
12
|
-
getConcurrencyKeyFromInput: (input: LaunchInput) => string;
|
|
13
|
-
processKey: (key: string) => void;
|
|
14
|
-
}): BackgroundTask;
|
|
15
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
export declare function getTasksByParentSession(tasks: Iterable<BackgroundTask>, sessionID: string): BackgroundTask[];
|
|
3
|
-
export declare function getAllDescendantTasks(tasksByParent: (sessionID: string) => BackgroundTask[], sessionID: string): BackgroundTask[];
|
|
4
|
-
export declare function findTaskBySession(tasks: Iterable<BackgroundTask>, sessionID: string): BackgroundTask | undefined;
|
|
5
|
-
export declare function getRunningTasks(tasks: Iterable<BackgroundTask>): BackgroundTask[];
|
|
6
|
-
export declare function getNonRunningTasks(tasks: Iterable<BackgroundTask>): BackgroundTask[];
|
|
7
|
-
export declare function hasRunningTasks(tasks: Iterable<BackgroundTask>): boolean;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
type QueueItem = {
|
|
4
|
-
task: BackgroundTask;
|
|
5
|
-
input: import("./types").LaunchInput;
|
|
6
|
-
};
|
|
7
|
-
export declare function processConcurrencyKeyQueue(args: {
|
|
8
|
-
key: string;
|
|
9
|
-
queuesByKey: Map<string, QueueItem[]>;
|
|
10
|
-
processingKeys: Set<string>;
|
|
11
|
-
concurrencyManager: ConcurrencyManager;
|
|
12
|
-
startTask: (item: QueueItem) => Promise<void>;
|
|
13
|
-
}): Promise<void>;
|
|
14
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask, ResumeInput } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
4
|
-
export declare function resumeBackgroundTask(args: {
|
|
5
|
-
input: ResumeInput;
|
|
6
|
-
findBySession: (sessionID: string) => BackgroundTask | undefined;
|
|
7
|
-
client: OpencodeClient;
|
|
8
|
-
concurrencyManager: ConcurrencyManager;
|
|
9
|
-
pendingByParent: Map<string, Set<string>>;
|
|
10
|
-
startPolling: () => void;
|
|
11
|
-
markForNotification: (task: BackgroundTask) => void;
|
|
12
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
13
|
-
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
14
|
-
}): Promise<BackgroundTask>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { LaunchInput } from "./types";
|
|
3
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
4
|
-
import type { OpencodeClient } from "./opencode-client";
|
|
5
|
-
type QueueItem = {
|
|
6
|
-
task: BackgroundTask;
|
|
7
|
-
input: LaunchInput;
|
|
8
|
-
};
|
|
9
|
-
export declare function startQueuedTask(args: {
|
|
10
|
-
item: QueueItem;
|
|
11
|
-
client: OpencodeClient;
|
|
12
|
-
defaultDirectory: string;
|
|
13
|
-
tmuxEnabled: boolean;
|
|
14
|
-
onSubagentSessionCreated?: (event: {
|
|
15
|
-
sessionID: string;
|
|
16
|
-
parentID: string;
|
|
17
|
-
title: string;
|
|
18
|
-
}) => Promise<void>;
|
|
19
|
-
startPolling: () => void;
|
|
20
|
-
getConcurrencyKeyFromInput: (input: LaunchInput) => string;
|
|
21
|
-
concurrencyManager: ConcurrencyManager;
|
|
22
|
-
findBySession: (sessionID: string) => BackgroundTask | undefined;
|
|
23
|
-
markForNotification: (task: BackgroundTask) => void;
|
|
24
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
25
|
-
notifyParentSession: (task: BackgroundTask) => Promise<void>;
|
|
26
|
-
}): Promise<void>;
|
|
27
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { BackgroundTask } from "./types";
|
|
2
|
-
import type { ConcurrencyManager } from "./concurrency";
|
|
3
|
-
export declare function trackExternalTask(args: {
|
|
4
|
-
input: {
|
|
5
|
-
taskId: string;
|
|
6
|
-
sessionID: string;
|
|
7
|
-
parentSessionID: string;
|
|
8
|
-
description: string;
|
|
9
|
-
agent?: string;
|
|
10
|
-
parentAgent?: string;
|
|
11
|
-
concurrencyKey?: string;
|
|
12
|
-
};
|
|
13
|
-
tasks: Map<string, BackgroundTask>;
|
|
14
|
-
pendingByParent: Map<string, Set<string>>;
|
|
15
|
-
concurrencyManager: ConcurrencyManager;
|
|
16
|
-
startPolling: () => void;
|
|
17
|
-
cleanupPendingByParent: (task: BackgroundTask) => void;
|
|
18
|
-
}): Promise<BackgroundTask>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { TmuxConfig } from "../../config/schema";
|
|
2
|
-
import type { TrackedSession } from "./types";
|
|
3
|
-
import { TmuxPollingManager } from "./polling-manager";
|
|
4
|
-
export declare class ManagerCleanup {
|
|
5
|
-
private sessions;
|
|
6
|
-
private sourcePaneId;
|
|
7
|
-
private pollingManager;
|
|
8
|
-
private tmuxConfig;
|
|
9
|
-
private serverUrl;
|
|
10
|
-
constructor(sessions: Map<string, TrackedSession>, sourcePaneId: string | undefined, pollingManager: TmuxPollingManager, tmuxConfig: TmuxConfig, serverUrl: string);
|
|
11
|
-
cleanup(): Promise<void>;
|
|
12
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { TmuxConfig } from "../../config/schema";
|
|
2
|
-
import type { TrackedSession } from "./types";
|
|
3
|
-
import type { SessionMapping } from "./decision-engine";
|
|
4
|
-
import { TmuxPollingManager } from "./polling-manager";
|
|
5
|
-
export interface TmuxUtilDeps {
|
|
6
|
-
isInsideTmux: () => boolean;
|
|
7
|
-
getCurrentPaneId: () => string | undefined;
|
|
8
|
-
}
|
|
9
|
-
export declare class SessionCleaner {
|
|
10
|
-
private tmuxConfig;
|
|
11
|
-
private deps;
|
|
12
|
-
private sessions;
|
|
13
|
-
private sourcePaneId;
|
|
14
|
-
private getSessionMappings;
|
|
15
|
-
private pollingManager;
|
|
16
|
-
private serverUrl;
|
|
17
|
-
constructor(tmuxConfig: TmuxConfig, deps: TmuxUtilDeps, sessions: Map<string, TrackedSession>, sourcePaneId: string | undefined, getSessionMappings: () => SessionMapping[], pollingManager: TmuxPollingManager, serverUrl: string);
|
|
18
|
-
private isEnabled;
|
|
19
|
-
onSessionDeleted(event: {
|
|
20
|
-
sessionID: string;
|
|
21
|
-
}): Promise<void>;
|
|
22
|
-
closeSessionById(sessionId: string): Promise<void>;
|
|
23
|
-
}
|