oh-my-opencode 3.7.3 → 3.8.0
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 +206 -243
- package/README.ko.md +205 -244
- package/README.md +176 -174
- package/README.zh-cn.md +211 -255
- package/dist/agents/atlas/default.d.ts +1 -1
- package/dist/agents/atlas/gpt.d.ts +1 -1
- package/dist/agents/atlas/prompt-section-builder.d.ts +1 -1
- package/dist/agents/builtin-agents/environment-context.d.ts +5 -1
- package/dist/agents/builtin-agents/general-agents.d.ts +1 -0
- package/dist/agents/builtin-agents/hephaestus-agent.d.ts +1 -0
- package/dist/agents/builtin-agents/sisyphus-agent.d.ts +1 -0
- package/dist/agents/builtin-agents.d.ts +1 -1
- package/dist/agents/dynamic-agent-prompt-builder.d.ts +0 -5
- package/dist/agents/index.d.ts +2 -1
- package/dist/agents/metis.d.ts +1 -1
- package/dist/agents/prometheus/behavioral-summary.d.ts +1 -1
- package/dist/agents/prometheus/gpt.d.ts +24 -0
- package/dist/agents/prometheus/identity-constraints.d.ts +1 -1
- package/dist/agents/prometheus/index.d.ts +3 -1
- package/dist/agents/prometheus/interview-mode.d.ts +1 -1
- package/dist/agents/prometheus/plan-generation.d.ts +1 -1
- package/dist/agents/prometheus/plan-template.d.ts +1 -1
- package/dist/agents/prometheus/system-prompt.d.ts +13 -2
- package/dist/agents/sisyphus-junior/agent.d.ts +1 -1
- package/dist/agents/types.d.ts +1 -0
- package/dist/cli/config-manager/antigravity-provider-configuration.d.ts +2 -2
- package/dist/cli/fallback-chain-resolution.d.ts +1 -1
- package/dist/cli/index.js +527 -175
- package/dist/cli/model-fallback-requirements.d.ts +3 -0
- package/dist/cli/provider-model-id-transform.d.ts +1 -1
- package/dist/cli/run/event-state.d.ts +4 -0
- package/dist/cli/run/stdin-suppression.d.ts +12 -0
- package/dist/cli/run/timestamp-output.d.ts +5 -0
- package/dist/cli/run/types.d.ts +1 -0
- package/dist/config/index.d.ts +2 -2
- package/dist/config/schema/agent-overrides.d.ts +75 -0
- package/dist/config/schema/categories.d.ts +2 -0
- package/dist/config/schema/experimental.d.ts +2 -0
- package/dist/config/schema/fallback-models.d.ts +3 -0
- package/dist/config/schema/hooks.d.ts +4 -3
- package/dist/config/schema/oh-my-opencode-config.d.ts +87 -47
- package/dist/config/schema/ralph-loop.d.ts +4 -0
- package/dist/config/schema/runtime-fallback.d.ts +10 -0
- package/dist/config/schema.d.ts +2 -0
- package/dist/create-hooks.d.ts +8 -5
- package/dist/features/background-agent/manager.d.ts +3 -0
- package/dist/features/background-agent/parent-session-context-resolver.d.ts +1 -0
- package/dist/features/background-agent/types.d.ts +7 -0
- package/dist/features/builtin-commands/templates/ralph-loop.d.ts +1 -1
- package/dist/features/claude-code-session-state/state.d.ts +1 -0
- package/dist/features/task-toast-manager/manager.d.ts +5 -0
- package/dist/features/task-toast-manager/types.d.ts +2 -1
- package/dist/features/tmux-subagent/action-executor.d.ts +10 -3
- package/dist/features/tmux-subagent/grid-planning.d.ts +5 -3
- package/dist/features/tmux-subagent/manager.d.ts +12 -0
- package/dist/features/tmux-subagent/pane-split-availability.d.ts +0 -1
- package/dist/features/tmux-subagent/spawn-target-finder.d.ts +2 -2
- package/dist/features/tmux-subagent/tmux-grid-constants.d.ts +4 -0
- package/dist/features/tmux-subagent/types.d.ts +2 -0
- package/dist/hooks/atlas/recent-model-resolver.d.ts +6 -0
- package/dist/hooks/atlas/system-reminder-templates.d.ts +1 -1
- package/dist/hooks/hashline-edit-diff-enhancer/hook.d.ts +28 -0
- package/dist/hooks/hashline-edit-diff-enhancer/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +5 -2
- package/dist/hooks/model-fallback/hook.d.ts +60 -0
- package/dist/hooks/no-hephaestus-non-gpt/hook.d.ts +16 -0
- package/dist/hooks/no-hephaestus-non-gpt/index.d.ts +1 -0
- package/dist/hooks/{sisyphus-gpt-hephaestus-reminder → no-sisyphus-gpt}/hook.d.ts +6 -1
- package/dist/hooks/no-sisyphus-gpt/index.d.ts +1 -0
- package/dist/hooks/ralph-loop/command-arguments.d.ts +8 -0
- package/dist/hooks/ralph-loop/continuation-prompt-injector.d.ts +1 -0
- package/dist/hooks/ralph-loop/iteration-continuation.d.ts +12 -0
- package/dist/hooks/ralph-loop/loop-state-controller.d.ts +2 -0
- package/dist/hooks/ralph-loop/ralph-loop-event-handler.d.ts +1 -0
- package/dist/hooks/ralph-loop/ralph-loop-hook.d.ts +1 -0
- package/dist/hooks/ralph-loop/session-reset-strategy.d.ts +3 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/hooks/runtime-fallback/agent-resolver.d.ts +5 -0
- package/dist/hooks/runtime-fallback/auto-retry.d.ts +10 -0
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +20 -0
- package/dist/hooks/runtime-fallback/constants.d.ts +19 -0
- package/dist/hooks/runtime-fallback/error-classifier.d.ts +17 -0
- package/dist/hooks/runtime-fallback/event-handler.d.ts +8 -0
- package/dist/hooks/runtime-fallback/fallback-models.d.ts +2 -0
- package/dist/hooks/runtime-fallback/fallback-state.d.ts +6 -0
- package/dist/hooks/runtime-fallback/hook.d.ts +3 -0
- package/dist/hooks/runtime-fallback/index.d.ts +2 -0
- package/dist/hooks/runtime-fallback/message-update-handler.d.ts +5 -0
- package/dist/hooks/runtime-fallback/types.d.ts +59 -0
- package/dist/hooks/session-recovery/detect-error-type.d.ts +2 -1
- package/dist/hooks/session-recovery/recover-unavailable-tool.d.ts +5 -0
- package/dist/hooks/session-recovery/types.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/continuation-injection.d.ts +1 -0
- package/dist/hooks/todo-continuation-enforcer/countdown.d.ts +1 -0
- package/dist/hooks/unstable-agent-babysitter/task-message-analyzer.d.ts +1 -0
- package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +2 -0
- package/dist/hooks/write-existing-file-guard/hook.d.ts +1 -0
- package/dist/index.js +6614 -3149
- package/dist/oh-my-opencode.schema.json +3681 -0
- package/dist/plugin/chat-headers.d.ts +4 -0
- package/dist/plugin/chat-message.d.ts +9 -8
- package/dist/plugin/chat-params.d.ts +2 -3
- package/dist/plugin/event.d.ts +2 -6
- package/dist/plugin/hooks/create-core-hooks.d.ts +8 -5
- package/dist/plugin/hooks/create-session-hooks.d.ts +7 -5
- package/dist/plugin/hooks/create-tool-guard-hooks.d.ts +2 -1
- package/dist/plugin/hooks/create-transform-hooks.d.ts +1 -1
- package/dist/plugin/system-transform.d.ts +5 -0
- package/dist/plugin/types.d.ts +7 -1
- package/dist/plugin/ultrawork-db-model-override.d.ts +11 -0
- package/dist/plugin/ultrawork-model-override.d.ts +37 -0
- package/dist/shared/index.d.ts +4 -0
- package/dist/shared/internal-initiator-marker.d.ts +5 -0
- package/dist/shared/model-error-classifier.d.ts +31 -0
- package/dist/shared/model-resolution-pipeline.d.ts +1 -0
- package/dist/shared/model-resolver.d.ts +6 -0
- package/dist/shared/prompt-tools.d.ts +3 -0
- package/dist/shared/provider-model-id-transform.d.ts +1 -0
- package/dist/shared/session-category-registry.d.ts +32 -0
- package/dist/shared/session-model-state.d.ts +7 -0
- package/dist/shared/tmux/tmux-utils/layout.d.ts +17 -2
- package/dist/tools/delegate-task/background-task.d.ts +2 -1
- package/dist/tools/delegate-task/category-resolver.d.ts +2 -0
- package/dist/tools/delegate-task/constants.d.ts +1 -1
- package/dist/tools/delegate-task/skill-resolver.d.ts +1 -0
- package/dist/tools/delegate-task/subagent-resolver.d.ts +2 -0
- package/dist/tools/delegate-task/sync-task.d.ts +1 -1
- package/dist/tools/hashline-edit/constants.d.ts +5 -2
- package/dist/tools/hashline-edit/diff-utils.d.ts +6 -0
- package/dist/tools/hashline-edit/edit-operations.d.ts +4 -4
- package/dist/tools/hashline-edit/hash-computation.d.ts +1 -1
- package/dist/tools/hashline-edit/index.d.ts +1 -1
- package/dist/tools/hashline-edit/types.d.ts +4 -4
- package/dist/tools/hashline-edit/validation.d.ts +1 -0
- package/dist/tools/index.d.ts +2 -2
- package/dist/tools/skill/constants.d.ts +2 -2
- package/dist/tools/skill/types.d.ts +4 -0
- package/dist/tools/slashcommand/index.d.ts +1 -1
- package/dist/tools/slashcommand/types.d.ts +1 -7
- package/package.json +10 -10
- package/dist/cli/run/opencode-bin-path.d.ts +0 -3
- package/dist/hooks/sisyphus-gpt-hephaestus-reminder/index.d.ts +0 -1
- package/dist/tools/slashcommand/skill-command-converter.d.ts +0 -3
- package/dist/tools/slashcommand/slashcommand-description.d.ts +0 -3
- package/dist/tools/slashcommand/slashcommand-tool.d.ts +0 -4
- package/dist/tools/slashcommand/tools.d.ts +0 -2
|
@@ -10,21 +10,22 @@ type ChatMessagePart = {
|
|
|
10
10
|
text?: string;
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
};
|
|
13
|
-
type ChatMessageHandlerOutput = {
|
|
13
|
+
export type ChatMessageHandlerOutput = {
|
|
14
14
|
message: Record<string, unknown>;
|
|
15
15
|
parts: ChatMessagePart[];
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
ctx: PluginContext;
|
|
19
|
-
pluginConfig: OhMyOpenCodeConfig;
|
|
20
|
-
firstMessageVariantGate: FirstMessageVariantGate;
|
|
21
|
-
hooks: CreatedHooks;
|
|
22
|
-
}): (input: {
|
|
17
|
+
export type ChatMessageInput = {
|
|
23
18
|
sessionID: string;
|
|
24
19
|
agent?: string;
|
|
25
20
|
model?: {
|
|
26
21
|
providerID: string;
|
|
27
22
|
modelID: string;
|
|
28
23
|
};
|
|
29
|
-
}
|
|
24
|
+
};
|
|
25
|
+
export declare function createChatMessageHandler(args: {
|
|
26
|
+
ctx: PluginContext;
|
|
27
|
+
pluginConfig: OhMyOpenCodeConfig;
|
|
28
|
+
firstMessageVariantGate: FirstMessageVariantGate;
|
|
29
|
+
hooks: CreatedHooks;
|
|
30
|
+
}): (input: ChatMessageInput, output: ChatMessageHandlerOutput) => Promise<void>;
|
|
30
31
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type ChatParamsInput = {
|
|
1
|
+
export type ChatParamsInput = {
|
|
2
2
|
sessionID: string;
|
|
3
3
|
agent: {
|
|
4
4
|
name?: string;
|
|
@@ -14,7 +14,7 @@ type ChatParamsInput = {
|
|
|
14
14
|
variant?: string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
17
|
-
type ChatParamsOutput = {
|
|
17
|
+
export type ChatParamsOutput = {
|
|
18
18
|
temperature?: number;
|
|
19
19
|
topP?: number;
|
|
20
20
|
topK?: number;
|
|
@@ -25,4 +25,3 @@ export declare function createChatParamsHandler(args: {
|
|
|
25
25
|
"chat.params"?: (input: ChatParamsInput, output: ChatParamsOutput) => Promise<void>;
|
|
26
26
|
} | null;
|
|
27
27
|
}): (input: unknown, output: unknown) => Promise<void>;
|
|
28
|
-
export {};
|
package/dist/plugin/event.d.ts
CHANGED
|
@@ -10,16 +10,12 @@ type FirstMessageVariantGate = {
|
|
|
10
10
|
} | undefined) => void;
|
|
11
11
|
clear: (sessionID: string) => void;
|
|
12
12
|
};
|
|
13
|
+
type EventInput = Parameters<NonNullable<NonNullable<CreatedHooks["writeExistingFileGuard"]>["event"]>>[0];
|
|
13
14
|
export declare function createEventHandler(args: {
|
|
14
15
|
ctx: PluginContext;
|
|
15
16
|
pluginConfig: OhMyOpenCodeConfig;
|
|
16
17
|
firstMessageVariantGate: FirstMessageVariantGate;
|
|
17
18
|
managers: Managers;
|
|
18
19
|
hooks: CreatedHooks;
|
|
19
|
-
}): (input:
|
|
20
|
-
event: {
|
|
21
|
-
type: string;
|
|
22
|
-
properties?: Record<string, unknown>;
|
|
23
|
-
};
|
|
24
|
-
}) => Promise<void>;
|
|
20
|
+
}): (input: EventInput) => Promise<void>;
|
|
25
21
|
export {};
|
|
@@ -8,7 +8,7 @@ export declare function createCoreHooks(args: {
|
|
|
8
8
|
isHookEnabled: (hookName: HookName) => boolean;
|
|
9
9
|
safeHookEnabled: boolean;
|
|
10
10
|
}): {
|
|
11
|
-
claudeCodeHooks: ReturnType<typeof import("../../hooks").createClaudeCodeHooksHook
|
|
11
|
+
claudeCodeHooks: ReturnType<typeof import("../../hooks").createClaudeCodeHooksHook> | null;
|
|
12
12
|
keywordDetector: ReturnType<typeof import("../../hooks").createKeywordDetectorHook> | null;
|
|
13
13
|
contextInjectorMessagesTransform: ReturnType<typeof import("../../features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
14
14
|
thinkingBlockValidator: ReturnType<typeof import("../../hooks").createThinkingBlockValidatorHook> | null;
|
|
@@ -21,11 +21,13 @@ export declare function createCoreHooks(args: {
|
|
|
21
21
|
tasksTodowriteDisabler: ReturnType<typeof import("../../hooks").createTasksTodowriteDisablerHook> | null;
|
|
22
22
|
writeExistingFileGuard: ReturnType<typeof import("../../hooks").createWriteExistingFileGuardHook> | null;
|
|
23
23
|
hashlineReadEnhancer: ReturnType<typeof import("../../hooks").createHashlineReadEnhancerHook> | null;
|
|
24
|
+
jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
|
|
24
25
|
contextWindowMonitor: ReturnType<typeof import("../../hooks").createContextWindowMonitorHook> | null;
|
|
25
26
|
preemptiveCompaction: ReturnType<typeof import("../../hooks").createPreemptiveCompactionHook> | null;
|
|
26
27
|
sessionRecovery: ReturnType<typeof import("../../hooks").createSessionRecoveryHook> | null;
|
|
27
28
|
sessionNotification: ReturnType<typeof import("../../hooks").createSessionNotification> | null;
|
|
28
29
|
thinkMode: ReturnType<typeof import("../../hooks").createThinkModeHook> | null;
|
|
30
|
+
modelFallback: ReturnType<typeof import("../../hooks").createModelFallbackHook> | null;
|
|
29
31
|
anthropicContextWindowLimitRecovery: ReturnType<typeof import("../../hooks").createAnthropicContextWindowLimitRecoveryHook> | null;
|
|
30
32
|
autoUpdateChecker: ReturnType<typeof import("../../hooks").createAutoUpdateCheckerHook> | null;
|
|
31
33
|
agentUsageReminder: ReturnType<typeof import("../../hooks").createAgentUsageReminderHook> | null;
|
|
@@ -33,13 +35,14 @@ export declare function createCoreHooks(args: {
|
|
|
33
35
|
interactiveBashSession: ReturnType<typeof import("../../hooks").createInteractiveBashSessionHook> | null;
|
|
34
36
|
ralphLoop: ReturnType<typeof import("../../hooks").createRalphLoopHook> | null;
|
|
35
37
|
editErrorRecovery: ReturnType<typeof import("../../hooks").createEditErrorRecoveryHook> | null;
|
|
36
|
-
jsonErrorRecovery: ReturnType<typeof import("../../hooks").createJsonErrorRecoveryHook> | null;
|
|
37
38
|
delegateTaskRetry: ReturnType<typeof import("../../hooks").createDelegateTaskRetryHook> | null;
|
|
38
39
|
startWork: ReturnType<typeof import("../../hooks").createStartWorkHook> | null;
|
|
39
40
|
prometheusMdOnly: ReturnType<typeof import("../../hooks").createPrometheusMdOnlyHook> | null;
|
|
40
41
|
sisyphusJuniorNotepad: ReturnType<typeof import("../../hooks").createSisyphusJuniorNotepadHook> | null;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
noSisyphusGpt: ReturnType<typeof import("../../hooks").createNoSisyphusGptHook> | null;
|
|
43
|
+
noHephaestusNonGpt: ReturnType<typeof import("../../hooks").createNoHephaestusNonGptHook> | null;
|
|
44
|
+
questionLabelTruncator: ReturnType<typeof import("../../hooks").createQuestionLabelTruncatorHook> | null;
|
|
45
|
+
taskResumeInfo: ReturnType<typeof import("../../hooks").createTaskResumeInfoHook> | null;
|
|
44
46
|
anthropicEffort: ReturnType<typeof import("../../hooks/anthropic-effort").createAnthropicEffortHook> | null;
|
|
47
|
+
runtimeFallback: ReturnType<typeof import("../../hooks").createRuntimeFallbackHook> | null;
|
|
45
48
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { OhMyOpenCodeConfig, HookName } from "../../config";
|
|
2
2
|
import type { ModelCacheState } from "../../plugin-state";
|
|
3
3
|
import type { PluginContext } from "../types";
|
|
4
|
-
import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook,
|
|
4
|
+
import { createContextWindowMonitorHook, createSessionRecoveryHook, createSessionNotification, createThinkModeHook, createModelFallbackHook, createAnthropicContextWindowLimitRecoveryHook, createAutoUpdateCheckerHook, createAgentUsageReminderHook, createNonInteractiveEnvHook, createInteractiveBashSessionHook, createRalphLoopHook, createEditErrorRecoveryHook, createDelegateTaskRetryHook, createTaskResumeInfoHook, createStartWorkHook, createPrometheusMdOnlyHook, createSisyphusJuniorNotepadHook, createNoSisyphusGptHook, createNoHephaestusNonGptHook, createQuestionLabelTruncatorHook, createPreemptiveCompactionHook, createRuntimeFallbackHook } from "../../hooks";
|
|
5
5
|
import { createAnthropicEffortHook } from "../../hooks/anthropic-effort";
|
|
6
6
|
export type SessionHooks = {
|
|
7
7
|
contextWindowMonitor: ReturnType<typeof createContextWindowMonitorHook> | null;
|
|
@@ -9,6 +9,7 @@ export type SessionHooks = {
|
|
|
9
9
|
sessionRecovery: ReturnType<typeof createSessionRecoveryHook> | null;
|
|
10
10
|
sessionNotification: ReturnType<typeof createSessionNotification> | null;
|
|
11
11
|
thinkMode: ReturnType<typeof createThinkModeHook> | null;
|
|
12
|
+
modelFallback: ReturnType<typeof createModelFallbackHook> | null;
|
|
12
13
|
anthropicContextWindowLimitRecovery: ReturnType<typeof createAnthropicContextWindowLimitRecoveryHook> | null;
|
|
13
14
|
autoUpdateChecker: ReturnType<typeof createAutoUpdateCheckerHook> | null;
|
|
14
15
|
agentUsageReminder: ReturnType<typeof createAgentUsageReminderHook> | null;
|
|
@@ -16,15 +17,16 @@ export type SessionHooks = {
|
|
|
16
17
|
interactiveBashSession: ReturnType<typeof createInteractiveBashSessionHook> | null;
|
|
17
18
|
ralphLoop: ReturnType<typeof createRalphLoopHook> | null;
|
|
18
19
|
editErrorRecovery: ReturnType<typeof createEditErrorRecoveryHook> | null;
|
|
19
|
-
jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
|
|
20
20
|
delegateTaskRetry: ReturnType<typeof createDelegateTaskRetryHook> | null;
|
|
21
21
|
startWork: ReturnType<typeof createStartWorkHook> | null;
|
|
22
22
|
prometheusMdOnly: ReturnType<typeof createPrometheusMdOnlyHook> | null;
|
|
23
23
|
sisyphusJuniorNotepad: ReturnType<typeof createSisyphusJuniorNotepadHook> | null;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
noSisyphusGpt: ReturnType<typeof createNoSisyphusGptHook> | null;
|
|
25
|
+
noHephaestusNonGpt: ReturnType<typeof createNoHephaestusNonGptHook> | null;
|
|
26
|
+
questionLabelTruncator: ReturnType<typeof createQuestionLabelTruncatorHook> | null;
|
|
27
|
+
taskResumeInfo: ReturnType<typeof createTaskResumeInfoHook> | null;
|
|
27
28
|
anthropicEffort: ReturnType<typeof createAnthropicEffortHook> | null;
|
|
29
|
+
runtimeFallback: ReturnType<typeof createRuntimeFallbackHook> | null;
|
|
28
30
|
};
|
|
29
31
|
export declare function createSessionHooks(args: {
|
|
30
32
|
ctx: PluginContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HookName, OhMyOpenCodeConfig } from "../../config";
|
|
2
2
|
import type { ModelCacheState } from "../../plugin-state";
|
|
3
3
|
import type { PluginContext } from "../types";
|
|
4
|
-
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook } from "../../hooks";
|
|
4
|
+
import { createCommentCheckerHooks, createToolOutputTruncatorHook, createDirectoryAgentsInjectorHook, createDirectoryReadmeInjectorHook, createEmptyTaskResponseDetectorHook, createRulesInjectorHook, createTasksTodowriteDisablerHook, createWriteExistingFileGuardHook, createHashlineReadEnhancerHook, createJsonErrorRecoveryHook } from "../../hooks";
|
|
5
5
|
export type ToolGuardHooks = {
|
|
6
6
|
commentChecker: ReturnType<typeof createCommentCheckerHooks> | null;
|
|
7
7
|
toolOutputTruncator: ReturnType<typeof createToolOutputTruncatorHook> | null;
|
|
@@ -12,6 +12,7 @@ export type ToolGuardHooks = {
|
|
|
12
12
|
tasksTodowriteDisabler: ReturnType<typeof createTasksTodowriteDisablerHook> | null;
|
|
13
13
|
writeExistingFileGuard: ReturnType<typeof createWriteExistingFileGuardHook> | null;
|
|
14
14
|
hashlineReadEnhancer: ReturnType<typeof createHashlineReadEnhancerHook> | null;
|
|
15
|
+
jsonErrorRecovery: ReturnType<typeof createJsonErrorRecoveryHook> | null;
|
|
15
16
|
};
|
|
16
17
|
export declare function createToolGuardHooks(args: {
|
|
17
18
|
ctx: PluginContext;
|
|
@@ -3,7 +3,7 @@ import type { PluginContext } from "../types";
|
|
|
3
3
|
import { createClaudeCodeHooksHook, createKeywordDetectorHook, createThinkingBlockValidatorHook } from "../../hooks";
|
|
4
4
|
import { createContextInjectorMessagesTransformHook } from "../../features/context-injector";
|
|
5
5
|
export type TransformHooks = {
|
|
6
|
-
claudeCodeHooks: ReturnType<typeof createClaudeCodeHooksHook
|
|
6
|
+
claudeCodeHooks: ReturnType<typeof createClaudeCodeHooksHook> | null;
|
|
7
7
|
keywordDetector: ReturnType<typeof createKeywordDetectorHook> | null;
|
|
8
8
|
contextInjectorMessagesTransform: ReturnType<typeof createContextInjectorMessagesTransformHook>;
|
|
9
9
|
thinkingBlockValidator: ReturnType<typeof createThinkingBlockValidatorHook> | null;
|
package/dist/plugin/types.d.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import type { Plugin, ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
export type PluginContext = Parameters<Plugin>[0];
|
|
3
3
|
export type PluginInstance = Awaited<ReturnType<Plugin>>;
|
|
4
|
-
|
|
4
|
+
type ChatHeadersHook = PluginInstance extends {
|
|
5
|
+
"chat.headers"?: infer T;
|
|
6
|
+
} ? T : (input: unknown, output: unknown) => Promise<void>;
|
|
7
|
+
export type PluginInterface = Omit<PluginInstance, "experimental.session.compacting" | "chat.headers"> & {
|
|
8
|
+
"chat.headers"?: ChatHeadersHook;
|
|
9
|
+
};
|
|
5
10
|
export type ToolsRecord = Record<string, ToolDefinition>;
|
|
6
11
|
export type TmuxConfig = {
|
|
7
12
|
enabled: boolean;
|
|
@@ -10,3 +15,4 @@ export type TmuxConfig = {
|
|
|
10
15
|
main_pane_min_width: number;
|
|
11
16
|
agent_pane_min_width: number;
|
|
12
17
|
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedules a deferred SQLite update to change the message model in the DB
|
|
3
|
+
* WITHOUT triggering a Bus event. Uses microtask retry loop to wait for
|
|
4
|
+
* Session.updateMessage() to save the message first, then overwrites the model.
|
|
5
|
+
*
|
|
6
|
+
* Falls back to setTimeout(fn, 0) after 10 microtask attempts.
|
|
7
|
+
*/
|
|
8
|
+
export declare function scheduleDeferredModelOverride(messageId: string, targetModel: {
|
|
9
|
+
providerID: string;
|
|
10
|
+
modelID: string;
|
|
11
|
+
}, variant?: string): void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
|
+
export declare function detectUltrawork(text: string): boolean;
|
|
3
|
+
export type UltraworkOverrideResult = {
|
|
4
|
+
providerID?: string;
|
|
5
|
+
modelID?: string;
|
|
6
|
+
variant?: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the ultrawork model override config for the given agent and prompt text.
|
|
10
|
+
* Returns null if no override should be applied.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveUltraworkOverride(pluginConfig: OhMyOpenCodeConfig, inputAgentName: string | undefined, output: {
|
|
13
|
+
message: Record<string, unknown>;
|
|
14
|
+
parts: Array<{
|
|
15
|
+
type: string;
|
|
16
|
+
text?: string;
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}>;
|
|
19
|
+
}, sessionID?: string): UltraworkOverrideResult | null;
|
|
20
|
+
/**
|
|
21
|
+
* Applies ultrawork model override using a deferred DB update strategy.
|
|
22
|
+
*
|
|
23
|
+
* Instead of directly mutating output.message.model (which would cause the TUI
|
|
24
|
+
* bottom bar to show the override model), this schedules a queueMicrotask that
|
|
25
|
+
* updates the message model directly in SQLite AFTER Session.updateMessage()
|
|
26
|
+
* saves the original model, but BEFORE loop() reads it for the API call.
|
|
27
|
+
*
|
|
28
|
+
* Result: API call uses opus, TUI bottom bar stays on sonnet.
|
|
29
|
+
*/
|
|
30
|
+
export declare function applyUltraworkModelOverrideOnMessage(pluginConfig: OhMyOpenCodeConfig, inputAgentName: string | undefined, output: {
|
|
31
|
+
message: Record<string, unknown>;
|
|
32
|
+
parts: Array<{
|
|
33
|
+
type: string;
|
|
34
|
+
text?: string;
|
|
35
|
+
[key: string]: unknown;
|
|
36
|
+
}>;
|
|
37
|
+
}, tui: unknown, sessionID?: string): void;
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export * from "./system-directive";
|
|
|
30
30
|
export * from "./agent-tool-restrictions";
|
|
31
31
|
export * from "./model-requirements";
|
|
32
32
|
export * from "./model-resolver";
|
|
33
|
+
export { normalizeFallbackModels } from "./model-resolver";
|
|
33
34
|
export { resolveModelPipeline } from "./model-resolution-pipeline";
|
|
34
35
|
export type { ModelResolutionRequest, ModelResolutionProvenance, ModelResolutionResult, } from "./model-resolution-types";
|
|
35
36
|
export * from "./model-availability";
|
|
@@ -48,3 +49,6 @@ export * from "./opencode-storage-paths";
|
|
|
48
49
|
export * from "./opencode-message-dir";
|
|
49
50
|
export * from "./normalize-sdk-response";
|
|
50
51
|
export * from "./session-directory-resolver";
|
|
52
|
+
export * from "./prompt-tools";
|
|
53
|
+
export * from "./internal-initiator-marker";
|
|
54
|
+
export { SessionCategoryRegistry } from "./session-category-registry";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { FallbackEntry } from "./model-requirements";
|
|
2
|
+
export interface ErrorInfo {
|
|
3
|
+
name?: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Determines if an error is a retryable model error.
|
|
8
|
+
* Returns true if the error is a known retryable type OR matches retryable message patterns.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isRetryableModelError(error: ErrorInfo): boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Determines if an error should trigger a fallback retry.
|
|
13
|
+
* Returns true for deadstop errors that completely halt the action loop.
|
|
14
|
+
*/
|
|
15
|
+
export declare function shouldRetryError(error: ErrorInfo): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Gets the next fallback model from the chain based on attempt count.
|
|
18
|
+
* Returns undefined if all fallbacks have been exhausted.
|
|
19
|
+
*/
|
|
20
|
+
export declare function getNextFallback(fallbackChain: FallbackEntry[], attemptCount: number): FallbackEntry | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if there are more fallbacks available after the current attempt.
|
|
23
|
+
*/
|
|
24
|
+
export declare function hasMoreFallbacks(fallbackChain: FallbackEntry[], attemptCount: number): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Selects the best provider for a fallback entry.
|
|
27
|
+
* Priority:
|
|
28
|
+
* 1) First connected provider in the entry's provider preference order
|
|
29
|
+
* 2) First provider listed in the fallback entry (when cache is missing)
|
|
30
|
+
*/
|
|
31
|
+
export declare function selectFallbackProvider(providers: string[], preferredProviderID?: string): string;
|
|
@@ -13,6 +13,7 @@ export type ModelResolutionResult = {
|
|
|
13
13
|
export type ExtendedModelResolutionInput = {
|
|
14
14
|
uiSelectedModel?: string;
|
|
15
15
|
userModel?: string;
|
|
16
|
+
userFallbackModels?: string[];
|
|
16
17
|
categoryDefaultModel?: string;
|
|
17
18
|
fallbackChain?: FallbackEntry[];
|
|
18
19
|
availableModels: Set<string>;
|
|
@@ -20,3 +21,8 @@ export type ExtendedModelResolutionInput = {
|
|
|
20
21
|
};
|
|
21
22
|
export declare function resolveModel(input: ModelResolutionInput): string | undefined;
|
|
22
23
|
export declare function resolveModelWithFallback(input: ExtendedModelResolutionInput): ModelResolutionResult | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Normalizes fallback_models config (which can be string or string[]) to string[]
|
|
26
|
+
* Centralized helper to avoid duplicated normalization logic
|
|
27
|
+
*/
|
|
28
|
+
export declare function normalizeFallbackModels(models: string | string[] | undefined): string[] | undefined;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type PromptToolPermission = boolean | "allow" | "deny" | "ask";
|
|
2
|
+
export declare function normalizePromptTools(tools: Record<string, PromptToolPermission> | undefined): Record<string, boolean> | undefined;
|
|
3
|
+
export declare function resolveInheritedPromptTools(sessionID: string, fallbackTools?: Record<string, PromptToolPermission>): Record<string, boolean> | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function transformModelForProvider(provider: string, model: string): string;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session Category Registry
|
|
3
|
+
*
|
|
4
|
+
* Maintains a mapping of session IDs to their assigned categories.
|
|
5
|
+
* Used by runtime-fallback hook to lookup category-specific fallback_models.
|
|
6
|
+
*/
|
|
7
|
+
export declare const SessionCategoryRegistry: {
|
|
8
|
+
/**
|
|
9
|
+
* Register a session with its category
|
|
10
|
+
*/
|
|
11
|
+
register: (sessionID: string, category: string) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Get the category for a session
|
|
14
|
+
*/
|
|
15
|
+
get: (sessionID: string) => string | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Remove a session from the registry (cleanup)
|
|
18
|
+
*/
|
|
19
|
+
remove: (sessionID: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a session is registered
|
|
22
|
+
*/
|
|
23
|
+
has: (sessionID: string) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Get the size of the registry (for debugging)
|
|
26
|
+
*/
|
|
27
|
+
size: () => number;
|
|
28
|
+
/**
|
|
29
|
+
* Clear all entries (use with caution, mainly for testing)
|
|
30
|
+
*/
|
|
31
|
+
clear: () => void;
|
|
32
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export type SessionModel = {
|
|
2
|
+
providerID: string;
|
|
3
|
+
modelID: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function setSessionModel(sessionID: string, model: SessionModel): void;
|
|
6
|
+
export declare function getSessionModel(sessionID: string): SessionModel | undefined;
|
|
7
|
+
export declare function clearSessionModel(sessionID: string): void;
|
|
@@ -1,3 +1,18 @@
|
|
|
1
1
|
import type { TmuxLayout } from "../../../config/schema";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type TmuxSpawnCommand = (args: string[], options: {
|
|
3
|
+
stdout: "ignore";
|
|
4
|
+
stderr: "ignore";
|
|
5
|
+
}) => {
|
|
6
|
+
exited: Promise<number>;
|
|
7
|
+
};
|
|
8
|
+
interface LayoutDeps {
|
|
9
|
+
spawnCommand?: TmuxSpawnCommand;
|
|
10
|
+
}
|
|
11
|
+
interface MainPaneWidthOptions {
|
|
12
|
+
mainPaneSize?: number;
|
|
13
|
+
mainPaneMinWidth?: number;
|
|
14
|
+
agentPaneMinWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function applyLayout(tmux: string, layout: TmuxLayout, mainPaneSize: number, deps?: LayoutDeps): Promise<void>;
|
|
17
|
+
export declare function enforceMainPaneWidth(mainPaneId: string, windowWidth: number, mainPaneSizeOrOptions?: number | MainPaneWidthOptions): Promise<void>;
|
|
18
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { DelegateTaskArgs, ToolContextWithMetadata } from "./types";
|
|
2
2
|
import type { ExecutorContext, ParentContext } from "./executor-types";
|
|
3
|
+
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
3
4
|
export declare function executeBackgroundTask(args: DelegateTaskArgs, ctx: ToolContextWithMetadata, executorCtx: ExecutorContext, parentContext: ParentContext, agentToUse: string, categoryModel: {
|
|
4
5
|
providerID: string;
|
|
5
6
|
modelID: string;
|
|
6
7
|
variant?: string;
|
|
7
|
-
} | undefined, systemContent: string | undefined): Promise<string>;
|
|
8
|
+
} | undefined, systemContent: string | undefined, fallbackChain?: FallbackEntry[]): Promise<string>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ModelFallbackInfo } from "../../features/task-toast-manager/types";
|
|
2
2
|
import type { DelegateTaskArgs } from "./types";
|
|
3
3
|
import type { ExecutorContext } from "./executor-types";
|
|
4
|
+
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
4
5
|
export interface CategoryResolutionResult {
|
|
5
6
|
agentToUse: string;
|
|
6
7
|
categoryModel: {
|
|
@@ -12,6 +13,7 @@ export interface CategoryResolutionResult {
|
|
|
12
13
|
modelInfo: ModelFallbackInfo | undefined;
|
|
13
14
|
actualModel: string | undefined;
|
|
14
15
|
isUnstableAgent: boolean;
|
|
16
|
+
fallbackChain?: FallbackEntry[];
|
|
15
17
|
error?: string;
|
|
16
18
|
}
|
|
17
19
|
export declare function resolveCategoryExecution(args: DelegateTaskArgs, executorCtx: ExecutorContext, inheritedModel: string | undefined, systemDefaultModel: string | undefined): Promise<CategoryResolutionResult>;
|
|
@@ -4,7 +4,7 @@ export declare const VISUAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou ar
|
|
|
4
4
|
export declare const ULTRABRAIN_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on DEEP LOGICAL REASONING / COMPLEX ARCHITECTURE tasks.\n\n**CRITICAL - CODE STYLE REQUIREMENTS (NON-NEGOTIABLE)**:\n1. BEFORE writing ANY code, SEARCH the existing codebase to find similar patterns/styles\n2. Your code MUST match the project's existing conventions - blend in seamlessly\n3. Write READABLE code that humans can easily understand - no clever tricks\n4. If unsure about style, explore more files until you find the pattern\n\nStrategic advisor mindset:\n- Bias toward simplicity: least complex solution that fulfills requirements\n- Leverage existing code/patterns over new components\n- Prioritize developer experience and maintainability\n- One clear recommendation with effort estimate (Quick/Short/Medium/Large)\n- Signal when advanced approach warranted\n\nResponse format:\n- Bottom line (2-3 sentences)\n- Action plan (numbered steps)\n- Risks and mitigations (if relevant)\n</Category_Context>";
|
|
5
5
|
export declare const ARTISTRY_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on HIGHLY CREATIVE / ARTISTIC tasks.\n\nArtistic genius mindset:\n- Push far beyond conventional boundaries\n- Explore radical, unconventional directions\n- Surprise and delight: unexpected twists, novel combinations\n- Rich detail and vivid expression\n- Break patterns deliberately when it serves the creative vision\n\nApproach:\n- Generate diverse, bold options first\n- Embrace ambiguity and wild experimentation\n- Balance novelty with coherence\n- This is for tasks requiring exceptional creativity\n</Category_Context>";
|
|
6
6
|
export declare const QUICK_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on SMALL / QUICK tasks.\n\nEfficient execution mindset:\n- Fast, focused, minimal overhead\n- Get to the point immediately\n- No over-engineering\n- Simple solutions for simple problems\n\nApproach:\n- Minimal viable implementation\n- Skip unnecessary abstractions\n- Direct and concise\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A LESS CAPABLE MODEL (claude-haiku-4-5).\n\nThe model executing this task has LIMITED reasoning capacity. Your prompt MUST be:\n\n**EXHAUSTIVELY EXPLICIT** - Leave NOTHING to interpretation:\n1. MUST DO: List every required action as atomic, numbered steps\n2. MUST NOT DO: Explicitly forbid likely mistakes and deviations\n3. EXPECTED OUTPUT: Describe exact success criteria with concrete examples\n\n**WHY THIS MATTERS:**\n- Less capable models WILL deviate without explicit guardrails\n- Vague instructions \u2192 unpredictable results\n- Implicit expectations \u2192 missed requirements\n\n**PROMPT STRUCTURE (MANDATORY):**\n```\nTASK: [One-sentence goal]\n\nMUST DO:\n1. [Specific action with exact details]\n2. [Another specific action]\n...\n\nMUST NOT DO:\n- [Forbidden action + why]\n- [Another forbidden action]\n...\n\nEXPECTED OUTPUT:\n- [Exact deliverable description]\n- [Success criteria / verification method]\n```\n\nIf your prompt lacks this structure, REWRITE IT before delegating.\n</Caller_Warning>";
|
|
7
|
-
export declare const UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on tasks that don't fit specific categories but require moderate effort.\n\n<Selection_Gate>\nBEFORE selecting this category, VERIFY ALL conditions:\n1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)\n2. Task requires more than trivial effort but is NOT system-wide\n3. Scope is contained within a few files/modules\n\nIf task fits ANY other category, DO NOT select unspecified-low.\nThis is NOT a default choice - it's for genuinely unclassifiable moderate-effort work.\n</Selection_Gate>\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A MID-TIER MODEL (claude-sonnet-4-
|
|
7
|
+
export declare const UNSPECIFIED_LOW_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on tasks that don't fit specific categories but require moderate effort.\n\n<Selection_Gate>\nBEFORE selecting this category, VERIFY ALL conditions:\n1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)\n2. Task requires more than trivial effort but is NOT system-wide\n3. Scope is contained within a few files/modules\n\nIf task fits ANY other category, DO NOT select unspecified-low.\nThis is NOT a default choice - it's for genuinely unclassifiable moderate-effort work.\n</Selection_Gate>\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A MID-TIER MODEL (claude-sonnet-4-6).\n\n**PROVIDE CLEAR STRUCTURE:**\n1. MUST DO: Enumerate required actions explicitly\n2. MUST NOT DO: State forbidden actions to prevent scope creep\n3. EXPECTED OUTPUT: Define concrete success criteria\n</Caller_Warning>";
|
|
8
8
|
export declare const UNSPECIFIED_HIGH_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on tasks that don't fit specific categories but require substantial effort.\n\n<Selection_Gate>\nBEFORE selecting this category, VERIFY ALL conditions:\n1. Task does NOT fit: quick (trivial), visual-engineering (UI), ultrabrain (deep logic), artistry (creative), writing (docs)\n2. Task requires substantial effort across multiple systems/modules\n3. Changes have broad impact or require careful coordination\n4. NOT just \"complex\" - must be genuinely unclassifiable AND high-effort\n\nIf task fits ANY other category, DO NOT select unspecified-high.\nIf task is unclassifiable but moderate-effort, use unspecified-low instead.\n</Selection_Gate>\n</Category_Context>";
|
|
9
9
|
export declare const WRITING_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on WRITING / PROSE tasks.\n\nWordsmith mindset:\n- Clear, flowing prose\n- Appropriate tone and voice\n- Engaging and readable\n- Proper structure and organization\n\nApproach:\n- Understand the audience\n- Draft with care\n- Polish for clarity and impact\n- Documentation, READMEs, articles, technical writing\n\nANTI-AI-SLOP RULES (NON-NEGOTIABLE):\n- NEVER use em dashes (\u2014) or en dashes (\u2013). Use commas, periods, ellipses, or line breaks instead. Zero tolerance.\n- Remove AI-sounding phrases: \"delve\", \"it's important to note\", \"I'd be happy to\", \"certainly\", \"please don't hesitate\", \"leverage\", \"utilize\", \"in order to\", \"moving forward\", \"circle back\", \"at the end of the day\", \"robust\", \"streamline\", \"facilitate\"\n- Pick plain words. \"Use\" not \"utilize\". \"Start\" not \"commence\". \"Help\" not \"facilitate\".\n- Use contractions naturally: \"don't\" not \"do not\", \"it's\" not \"it is\".\n- Vary sentence length. Don't make every sentence the same length.\n- NEVER start consecutive sentences with the same word.\n- No filler openings: skip \"In today's world...\", \"As we all know...\", \"It goes without saying...\"\n- Write like a human, not a corporate template.\n</Category_Context>";
|
|
10
10
|
export declare const DEEP_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on GOAL-ORIENTED AUTONOMOUS tasks.\n\n**CRITICAL - AUTONOMOUS EXECUTION MINDSET (NON-NEGOTIABLE)**:\nYou are NOT an interactive assistant. You are an autonomous problem-solver.\n\n**BEFORE making ANY changes**:\n1. SILENTLY explore the codebase extensively (5-15 minutes of reading is normal)\n2. Read related files, trace dependencies, understand the full context\n3. Build a complete mental model of the problem space\n4. DO NOT ask clarifying questions - the goal is already defined\n\n**Autonomous executor mindset**:\n- You receive a GOAL, not step-by-step instructions\n- Figure out HOW to achieve the goal yourself\n- Thorough research before any action\n- Fix hairy problems that require deep understanding\n- Work independently without frequent check-ins\n\n**Approach**:\n- Explore extensively, understand deeply, then act decisively\n- Prefer comprehensive solutions over quick patches\n- If the goal is unclear, make reasonable assumptions and proceed\n- Document your reasoning in code comments only when non-obvious\n\n**Response format**:\n- Minimal status updates (user trusts your autonomy)\n- Focus on results, not play-by-play progress\n- Report completion with summary of changes made\n</Category_Context>";
|
|
@@ -3,6 +3,7 @@ export declare function resolveSkillContent(skills: string[], options: {
|
|
|
3
3
|
gitMasterConfig?: GitMasterConfig;
|
|
4
4
|
browserProvider?: BrowserAutomationProvider;
|
|
5
5
|
disabledSkills?: Set<string>;
|
|
6
|
+
directory?: string;
|
|
6
7
|
}): Promise<{
|
|
7
8
|
content: string | undefined;
|
|
8
9
|
error: string | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { DelegateTaskArgs } from "./types";
|
|
2
2
|
import type { ExecutorContext } from "./executor-types";
|
|
3
|
+
import type { FallbackEntry } from "../../shared/model-requirements";
|
|
3
4
|
export declare function resolveSubagentExecution(args: DelegateTaskArgs, executorCtx: ExecutorContext, parentAgent: string | undefined, categoryExamples: string): Promise<{
|
|
4
5
|
agentToUse: string;
|
|
5
6
|
categoryModel: {
|
|
@@ -7,5 +8,6 @@ export declare function resolveSubagentExecution(args: DelegateTaskArgs, executo
|
|
|
7
8
|
modelID: string;
|
|
8
9
|
variant?: string;
|
|
9
10
|
} | undefined;
|
|
11
|
+
fallbackChain?: FallbackEntry[];
|
|
10
12
|
error?: string;
|
|
11
13
|
}>;
|
|
@@ -6,4 +6,4 @@ export declare function executeSyncTask(args: DelegateTaskArgs, ctx: ToolContext
|
|
|
6
6
|
providerID: string;
|
|
7
7
|
modelID: string;
|
|
8
8
|
variant?: string;
|
|
9
|
-
} | undefined, systemContent: string | undefined, modelInfo?: ModelFallbackInfo, deps?: SyncTaskDeps): Promise<string>;
|
|
9
|
+
} | undefined, systemContent: string | undefined, modelInfo?: ModelFallbackInfo, fallbackChain?: import("../../shared/model-requirements").FallbackEntry[], deps?: SyncTaskDeps): Promise<string>;
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const NIBBLE_STR = "ZPMQVRWSNKTXJBYH";
|
|
2
|
+
export declare const HASHLINE_DICT: string[];
|
|
3
|
+
export declare const HASHLINE_REF_PATTERN: RegExp;
|
|
4
|
+
export declare const HASHLINE_OUTPUT_PATTERN: RegExp;
|
|
5
|
+
export declare const HASHLINE_LEGACY_REF_PATTERN: RegExp;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare function toHashlineContent(content: string): string;
|
|
2
|
+
export declare function generateUnifiedDiff(oldContent: string, newContent: string, filePath: string): string;
|
|
3
|
+
export declare function countLineDiffs(oldContent: string, newContent: string): {
|
|
4
|
+
additions: number;
|
|
5
|
+
deletions: number;
|
|
6
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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;
|
|
2
|
+
export declare function applySetLine(lines: string[], anchor: string, newText: string | string[]): string[];
|
|
3
|
+
export declare function applyReplaceLines(lines: string[], startAnchor: string, endAnchor: string, newText: string | string[]): string[];
|
|
4
|
+
export declare function applyInsertAfter(lines: string[], anchor: string, text: string | string[]): string[];
|
|
5
|
+
export declare function applyReplace(content: string, oldText: string, newText: string | string[]): string;
|
|
6
6
|
export declare function applyHashlineEdits(content: string, edits: HashlineEdit[]): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare function computeLineHash(
|
|
1
|
+
export declare function computeLineHash(lineNumber: number, content: string): string;
|
|
2
2
|
export declare function formatHashLine(lineNumber: number, content: string): string;
|
|
3
3
|
export declare function formatHashLines(content: string): string;
|
|
@@ -2,6 +2,6 @@ export { computeLineHash, formatHashLine, formatHashLines } from "./hash-computa
|
|
|
2
2
|
export { parseLineRef, validateLineRef } from "./validation";
|
|
3
3
|
export type { LineRef } from "./validation";
|
|
4
4
|
export type { SetLine, ReplaceLines, InsertAfter, Replace, HashlineEdit } from "./types";
|
|
5
|
-
export {
|
|
5
|
+
export { NIBBLE_STR, HASHLINE_DICT, HASHLINE_REF_PATTERN, HASHLINE_OUTPUT_PATTERN } from "./constants";
|
|
6
6
|
export { applyHashlineEdits, applyInsertAfter, applyReplace, applyReplaceLines, applySetLine, } from "./edit-operations";
|
|
7
7
|
export { createHashlineEditTool } from "./tools";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
export interface SetLine {
|
|
2
2
|
type: "set_line";
|
|
3
3
|
line: string;
|
|
4
|
-
text: string;
|
|
4
|
+
text: string | string[];
|
|
5
5
|
}
|
|
6
6
|
export interface ReplaceLines {
|
|
7
7
|
type: "replace_lines";
|
|
8
8
|
start_line: string;
|
|
9
9
|
end_line: string;
|
|
10
|
-
text: string;
|
|
10
|
+
text: string | string[];
|
|
11
11
|
}
|
|
12
12
|
export interface InsertAfter {
|
|
13
13
|
type: "insert_after";
|
|
14
14
|
line: string;
|
|
15
|
-
text: string;
|
|
15
|
+
text: string | string[];
|
|
16
16
|
}
|
|
17
17
|
export interface Replace {
|
|
18
18
|
type: "replace";
|
|
19
19
|
old_text: string;
|
|
20
|
-
new_text: string;
|
|
20
|
+
new_text: string | string[];
|
|
21
21
|
}
|
|
22
22
|
export type HashlineEdit = SetLine | ReplaceLines | InsertAfter | Replace;
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ export { lspManager };
|
|
|
3
3
|
export { createAstGrepTools } from "./ast-grep";
|
|
4
4
|
export { createGrepTools } from "./grep";
|
|
5
5
|
export { createGlobTools } from "./glob";
|
|
6
|
-
export {
|
|
6
|
+
export { createSkillTool } from "./skill";
|
|
7
|
+
export { discoverCommandsSync } from "./slashcommand";
|
|
7
8
|
export { createSessionManagerTools } from "./session-manager";
|
|
8
9
|
export { sessionExists } from "./session-manager/storage";
|
|
9
10
|
export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
|
|
10
|
-
export { createSkillTool } from "./skill";
|
|
11
11
|
export { createSkillMcpTool } from "./skill-mcp";
|
|
12
12
|
import type { PluginInput, ToolDefinition } from "@opencode-ai/plugin";
|
|
13
13
|
import type { BackgroundManager } from "../features/background-agent";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const TOOL_NAME: "skill";
|
|
2
|
-
export declare const TOOL_DESCRIPTION_NO_SKILLS = "Load a skill to get detailed instructions for a specific task. No skills are currently available.";
|
|
3
|
-
export declare const TOOL_DESCRIPTION_PREFIX = "Load a skill to get detailed instructions for a specific task.\n\nSkills provide specialized knowledge and step-by-step guidance.\nUse this when a task matches an available skill's description
|
|
2
|
+
export declare const TOOL_DESCRIPTION_NO_SKILLS = "Load a skill or execute a slash command to get detailed instructions for a specific task. No skills are currently available.";
|
|
3
|
+
export declare const TOOL_DESCRIPTION_PREFIX = "Load a skill or execute a slash command to get detailed instructions for a specific task.\n\nSkills and commands provide specialized knowledge and step-by-step guidance.\nUse this when a task matches an available skill's or command's description.\n\n**How to use:**\n- Call with a skill name: name='code-review'\n- Call with a command name (without leading slash): name='publish'\n- The tool will return detailed instructions with your context applied.\n";
|