oh-my-opencode 3.0.0-beta.1 → 3.0.0-beta.11
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 +69 -816
- package/README.md +72 -949
- package/README.zh-cn.md +222 -959
- package/bin/oh-my-opencode.js +80 -0
- package/bin/platform.js +38 -0
- package/bin/platform.test.ts +148 -0
- package/dist/agents/metis.d.ts +1 -0
- package/dist/agents/momus.d.ts +1 -1
- package/dist/agents/orchestrator-sisyphus.d.ts +3 -2
- package/dist/agents/prometheus-prompt.d.ts +3 -1
- package/dist/agents/sisyphus-junior.d.ts +6 -2
- package/dist/agents/types.d.ts +1 -0
- package/dist/agents/utils.d.ts +3 -2
- package/dist/cli/config-manager.d.ts +9 -1
- package/dist/cli/doctor/checks/opencode.d.ts +5 -1
- package/dist/cli/index.js +3886 -3763
- package/dist/cli/run/events.d.ts +1 -0
- package/dist/cli/types.d.ts +3 -0
- package/dist/config/schema.d.ts +538 -208
- package/dist/features/background-agent/concurrency.d.ts +17 -0
- package/dist/features/background-agent/manager.d.ts +54 -5
- package/dist/features/background-agent/types.d.ts +13 -4
- package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
- package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
- package/dist/features/builtin-commands/types.d.ts +1 -1
- package/dist/features/claude-code-session-state/state.d.ts +6 -1
- package/dist/features/context-injector/index.d.ts +1 -1
- package/dist/features/context-injector/injector.d.ts +1 -1
- package/dist/features/hook-message-injector/index.d.ts +2 -2
- package/dist/features/hook-message-injector/injector.d.ts +7 -0
- package/dist/features/opencode-skill-loader/skill-content.d.ts +17 -2
- package/dist/features/skill-mcp-manager/manager.d.ts +11 -0
- package/dist/features/task-toast-manager/index.d.ts +1 -1
- package/dist/features/task-toast-manager/manager.d.ts +2 -1
- package/dist/features/task-toast-manager/types.d.ts +5 -0
- package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +1 -1
- package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +1 -2
- package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +0 -5
- package/dist/hooks/auto-update-checker/checker.d.ts +1 -1
- package/dist/hooks/auto-update-checker/index.d.ts +4 -0
- package/dist/hooks/background-compaction/index.d.ts +19 -0
- package/dist/hooks/background-notification/index.d.ts +6 -0
- package/dist/hooks/comment-checker/cli.d.ts +0 -1
- package/dist/hooks/compaction-context-injector/index.d.ts +7 -1
- package/dist/hooks/delegate-task-retry/index.d.ts +24 -0
- package/dist/hooks/index.d.ts +1 -2
- package/dist/hooks/keyword-detector/index.d.ts +2 -1
- package/dist/hooks/prometheus-md-only/constants.d.ts +2 -2
- package/dist/hooks/prometheus-md-only/index.d.ts +1 -1
- package/dist/hooks/ralph-loop/index.d.ts +1 -0
- package/dist/hooks/ralph-loop/types.d.ts +1 -0
- package/dist/index.js +24184 -25263
- package/dist/mcp/context7.d.ts +1 -0
- package/dist/mcp/grep-app.d.ts +1 -0
- package/dist/mcp/index.d.ts +1 -0
- package/dist/mcp/websearch.d.ts +1 -0
- package/dist/plugin-handlers/config-handler.d.ts +2 -0
- package/dist/plugin-handlers/config-handler.test.d.ts +1 -0
- package/dist/shared/agent-tool-restrictions.d.ts +7 -0
- package/dist/shared/agent-variant.d.ts +5 -0
- package/dist/shared/agent-variant.test.d.ts +1 -0
- package/dist/shared/deep-merge.test.d.ts +1 -0
- package/dist/shared/first-message-variant.d.ts +11 -0
- package/dist/shared/first-message-variant.test.d.ts +1 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/migration.d.ts +1 -0
- package/dist/shared/opencode-version.d.ts +6 -3
- package/dist/shared/permission-compat.d.ts +22 -7
- package/dist/shared/session-cursor.d.ts +13 -0
- package/dist/shared/session-cursor.test.d.ts +1 -0
- package/dist/shared/shell-env.d.ts +41 -0
- package/dist/shared/shell-env.test.d.ts +1 -0
- package/dist/shared/system-directive.d.ts +31 -0
- package/dist/shared/zip-extractor.d.ts +1 -0
- package/dist/tools/{sisyphus-task → delegate-task}/constants.d.ts +3 -3
- package/dist/tools/{sisyphus-task → delegate-task}/index.d.ts +1 -1
- package/dist/tools/{sisyphus-task → delegate-task}/tools.d.ts +5 -3
- package/dist/tools/delegate-task/tools.test.d.ts +1 -0
- package/dist/tools/{sisyphus-task → delegate-task}/types.d.ts +1 -1
- package/dist/tools/glob/cli.d.ts +4 -0
- package/dist/tools/glob/cli.test.d.ts +1 -0
- package/dist/tools/glob/types.d.ts +1 -0
- package/dist/tools/index.d.ts +3 -1
- package/dist/tools/interactive-bash/constants.d.ts +1 -1
- package/dist/tools/look-at/tools.d.ts +7 -0
- package/dist/tools/look-at/tools.test.d.ts +1 -0
- package/dist/tools/lsp/client.d.ts +1 -3
- package/dist/tools/lsp/config.test.d.ts +1 -0
- package/dist/tools/lsp/index.d.ts +1 -1
- package/dist/tools/lsp/tools.d.ts +1 -6
- package/dist/tools/lsp/types.d.ts +0 -33
- package/dist/tools/lsp/utils.d.ts +1 -4
- package/dist/tools/skill/tools.d.ts +1 -7
- package/dist/tools/skill/types.d.ts +3 -0
- package/dist/tools/skill-mcp/types.d.ts +1 -1
- package/dist/tools/slashcommand/tools.d.ts +1 -7
- package/package.json +21 -14
- package/postinstall.mjs +43 -0
- package/dist/agents/build-prompt.d.ts +0 -31
- package/dist/agents/plan-prompt.d.ts +0 -64
- package/dist/auth/antigravity/accounts.d.ts +0 -40
- package/dist/auth/antigravity/browser.d.ts +0 -27
- package/dist/auth/antigravity/cli.d.ts +0 -2
- package/dist/auth/antigravity/constants.d.ts +0 -98
- package/dist/auth/antigravity/fetch.d.ts +0 -69
- package/dist/auth/antigravity/index.d.ts +0 -13
- package/dist/auth/antigravity/integration.test.d.ts +0 -10
- package/dist/auth/antigravity/message-converter.d.ts +0 -54
- package/dist/auth/antigravity/oauth.d.ts +0 -51
- package/dist/auth/antigravity/plugin.d.ts +0 -54
- package/dist/auth/antigravity/project.d.ts +0 -10
- package/dist/auth/antigravity/request.d.ts +0 -116
- package/dist/auth/antigravity/response.d.ts +0 -137
- package/dist/auth/antigravity/storage.d.ts +0 -5
- package/dist/auth/antigravity/thinking.d.ts +0 -278
- package/dist/auth/antigravity/thinking.test.d.ts +0 -10
- package/dist/auth/antigravity/thought-signature-store.d.ts +0 -52
- package/dist/auth/antigravity/token.d.ts +0 -38
- package/dist/auth/antigravity/tools.d.ts +0 -119
- package/dist/auth/antigravity/types.d.ts +0 -229
- package/dist/cli/ast-grep-napi.linux-x64-gnu-jfv8414z.node +0 -0
- package/dist/cli/ast-grep-napi.linux-x64-musl-8cj2e5cf.node +0 -0
- package/dist/cli/commands/auth.d.ts +0 -2
- package/dist/google-auth.d.ts +0 -3
- package/dist/google-auth.js +0 -3871
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-executor.d.ts +0 -3
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-purge-errors.d.ts +0 -7
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-storage.d.ts +0 -2
- package/dist/hooks/anthropic-context-window-limit-recovery/pruning-supersede.d.ts +0 -6
- package/dist/hooks/comment-checker/constants.d.ts +0 -3
- package/dist/hooks/comment-checker/filters/bdd.d.ts +0 -2
- package/dist/hooks/comment-checker/filters/directive.d.ts +0 -2
- package/dist/hooks/comment-checker/filters/docstring.d.ts +0 -2
- package/dist/hooks/comment-checker/filters/index.d.ts +0 -7
- package/dist/hooks/comment-checker/filters/shebang.d.ts +0 -2
- package/dist/hooks/comment-checker/output/formatter.d.ts +0 -2
- package/dist/hooks/comment-checker/output/index.d.ts +0 -2
- package/dist/hooks/comment-checker/output/xml-builder.d.ts +0 -2
- package/dist/hooks/empty-message-sanitizer/index.d.ts +0 -12
- package/dist/hooks/preemptive-compaction/constants.d.ts +0 -3
- package/dist/hooks/preemptive-compaction/index.d.ts +0 -24
- package/dist/hooks/preemptive-compaction/types.d.ts +0 -17
- package/dist/tools/ast-grep/napi.d.ts +0 -13
- package/dist/tools/interactive-bash/types.d.ts +0 -3
- /package/dist/{auth/antigravity/accounts.test.d.ts → agents/momus.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/browser.test.d.ts → agents/prometheus-prompt.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/cli.test.d.ts → agents/sisyphus-junior.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/constants.test.d.ts → features/claude-code-session-state/state.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/oauth.test.d.ts → hooks/auto-update-checker/checker.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/request.test.d.ts → hooks/auto-update-checker/index.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/storage.test.d.ts → hooks/comment-checker/cli.test.d.ts} +0 -0
- /package/dist/{auth/antigravity/token.test.d.ts → hooks/delegate-task-retry/index.test.d.ts} +0 -0
- /package/dist/{tools/sisyphus-task/tools.test.d.ts → plugin-config.test.d.ts} +0 -0
package/dist/mcp/context7.d.ts
CHANGED
package/dist/mcp/grep-app.d.ts
CHANGED
package/dist/mcp/index.d.ts
CHANGED
package/dist/mcp/websearch.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
2
|
import type { ModelCacheState } from "../plugin-state";
|
|
3
|
+
import type { CategoryConfig } from "../config/schema";
|
|
3
4
|
export interface ConfigHandlerDeps {
|
|
4
5
|
ctx: {
|
|
5
6
|
directory: string;
|
|
@@ -7,4 +8,5 @@ export interface ConfigHandlerDeps {
|
|
|
7
8
|
pluginConfig: OhMyOpenCodeConfig;
|
|
8
9
|
modelCacheState: ModelCacheState;
|
|
9
10
|
}
|
|
11
|
+
export declare function resolveCategoryConfig(categoryName: string, userCategories?: Record<string, CategoryConfig>): CategoryConfig | undefined;
|
|
10
12
|
export declare function createConfigHandler(deps: ConfigHandlerDeps): (config: Record<string, unknown>) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent tool restrictions for session.prompt calls.
|
|
3
|
+
* OpenCode SDK's session.prompt `tools` parameter expects boolean values.
|
|
4
|
+
* true = tool allowed, false = tool denied.
|
|
5
|
+
*/
|
|
6
|
+
export declare function getAgentToolRestrictions(agentName: string): Record<string, boolean>;
|
|
7
|
+
export declare function hasAgentToolRestrictions(agentName: string): boolean;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { OhMyOpenCodeConfig } from "../config";
|
|
2
|
+
export declare function resolveAgentVariant(config: OhMyOpenCodeConfig, agentName?: string): string | undefined;
|
|
3
|
+
export declare function applyAgentVariant(config: OhMyOpenCodeConfig, agentName: string | undefined, message: {
|
|
4
|
+
variant?: string;
|
|
5
|
+
}): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type SessionInfo = {
|
|
2
|
+
id?: string;
|
|
3
|
+
parentID?: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function createFirstMessageVariantGate(): {
|
|
6
|
+
markSessionCreated(info?: SessionInfo): void;
|
|
7
|
+
shouldOverride(sessionID?: string): boolean;
|
|
8
|
+
markApplied(sessionID?: string): void;
|
|
9
|
+
clear(sessionID?: string): void;
|
|
10
|
+
};
|
|
11
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/shared/index.d.ts
CHANGED
|
@@ -20,3 +20,9 @@ export * from "./opencode-config-dir";
|
|
|
20
20
|
export * from "./opencode-version";
|
|
21
21
|
export * from "./permission-compat";
|
|
22
22
|
export * from "./external-plugin-detector";
|
|
23
|
+
export * from "./zip-extractor";
|
|
24
|
+
export * from "./agent-variant";
|
|
25
|
+
export * from "./session-cursor";
|
|
26
|
+
export * from "./shell-env";
|
|
27
|
+
export * from "./system-directive";
|
|
28
|
+
export * from "./agent-tool-restrictions";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const AGENT_NAME_MAP: Record<string, string>;
|
|
2
|
+
export declare const BUILTIN_AGENT_NAMES: Set<string>;
|
|
2
3
|
export declare const HOOK_NAME_MAP: Record<string, string>;
|
|
3
4
|
export declare const MODEL_TO_CATEGORY_MAP: Record<string, string>;
|
|
4
5
|
export declare function migrateAgentNames(agents: Record<string, unknown>): {
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Minimum OpenCode version required for this plugin.
|
|
3
|
+
* This plugin only supports OpenCode 1.1.1+ which uses the permission system.
|
|
4
|
+
*/
|
|
5
|
+
export declare const MINIMUM_OPENCODE_VERSION = "1.1.1";
|
|
2
6
|
export declare function parseVersion(version: string): number[];
|
|
3
7
|
export declare function compareVersions(a: string, b: string): -1 | 0 | 1;
|
|
4
8
|
export declare function isVersionGte(a: string, b: string): boolean;
|
|
5
9
|
export declare function isVersionLt(a: string, b: string): boolean;
|
|
6
10
|
export declare function getOpenCodeVersion(): string | null;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function usesLegacyToolsSystem(): boolean;
|
|
11
|
+
export declare function isOpenCodeVersionAtLeast(version: string): boolean;
|
|
9
12
|
export declare function resetVersionCache(): void;
|
|
10
13
|
export declare function setVersionCache(version: string | null): void;
|
|
@@ -1,12 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permission system utilities for OpenCode 1.1.1+.
|
|
3
|
+
* This module only supports the new permission format.
|
|
4
|
+
*/
|
|
1
5
|
export type PermissionValue = "ask" | "allow" | "deny";
|
|
2
|
-
export interface
|
|
3
|
-
tools: Record<string, boolean>;
|
|
4
|
-
}
|
|
5
|
-
export interface NewPermissionFormat {
|
|
6
|
+
export interface PermissionFormat {
|
|
6
7
|
permission: Record<string, PermissionValue>;
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Creates tool restrictions that deny specified tools.
|
|
11
|
+
*/
|
|
12
|
+
export declare function createAgentToolRestrictions(denyTools: string[]): PermissionFormat;
|
|
13
|
+
/**
|
|
14
|
+
* Creates tool restrictions that ONLY allow specified tools.
|
|
15
|
+
* All other tools are denied by default using `*: deny` pattern.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createAgentToolAllowlist(allowTools: string[]): PermissionFormat;
|
|
18
|
+
/**
|
|
19
|
+
* Converts legacy tools format to permission format.
|
|
20
|
+
* For migrating user configs from older versions.
|
|
21
|
+
*/
|
|
10
22
|
export declare function migrateToolsToPermission(tools: Record<string, boolean>): Record<string, PermissionValue>;
|
|
11
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Migrates agent config from legacy tools format to permission format.
|
|
25
|
+
* If config has `tools`, converts to `permission`.
|
|
26
|
+
*/
|
|
12
27
|
export declare function migrateAgentConfig(config: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type MessageTime = {
|
|
2
|
+
created?: number | string;
|
|
3
|
+
} | number | string | undefined;
|
|
4
|
+
type MessageInfo = {
|
|
5
|
+
id?: string;
|
|
6
|
+
time?: MessageTime;
|
|
7
|
+
};
|
|
8
|
+
export type CursorMessage = {
|
|
9
|
+
info?: MessageInfo;
|
|
10
|
+
};
|
|
11
|
+
export declare function consumeNewMessages<T extends CursorMessage>(sessionID: string | undefined, messages: T[]): T[];
|
|
12
|
+
export declare function resetMessageCursor(sessionID?: string): void;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export type ShellType = "unix" | "powershell" | "cmd";
|
|
2
|
+
/**
|
|
3
|
+
* Detect the current shell type based on environment variables.
|
|
4
|
+
*
|
|
5
|
+
* Detection priority:
|
|
6
|
+
* 1. PSModulePath → PowerShell
|
|
7
|
+
* 2. SHELL env var → Unix shell
|
|
8
|
+
* 3. Platform fallback → win32: cmd, others: unix
|
|
9
|
+
*/
|
|
10
|
+
export declare function detectShellType(): ShellType;
|
|
11
|
+
/**
|
|
12
|
+
* Shell-escape a value for use in environment variable assignment.
|
|
13
|
+
*
|
|
14
|
+
* @param value - The value to escape
|
|
15
|
+
* @param shellType - The target shell type
|
|
16
|
+
* @returns Escaped value appropriate for the shell
|
|
17
|
+
*/
|
|
18
|
+
export declare function shellEscape(value: string, shellType: ShellType): string;
|
|
19
|
+
/**
|
|
20
|
+
* Build environment variable prefix command for the target shell.
|
|
21
|
+
*
|
|
22
|
+
* @param env - Record of environment variables to set
|
|
23
|
+
* @param shellType - The target shell type
|
|
24
|
+
* @returns Command prefix string to prepend to the actual command
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* // Unix: "export VAR1=val1 VAR2=val2; command"
|
|
29
|
+
* buildEnvPrefix({ VAR1: "val1", VAR2: "val2" }, "unix")
|
|
30
|
+
* // => "export VAR1=val1 VAR2=val2;"
|
|
31
|
+
*
|
|
32
|
+
* // PowerShell: "$env:VAR1='val1'; $env:VAR2='val2'; command"
|
|
33
|
+
* buildEnvPrefix({ VAR1: "val1", VAR2: "val2" }, "powershell")
|
|
34
|
+
* // => "$env:VAR1='val1'; $env:VAR2='val2';"
|
|
35
|
+
*
|
|
36
|
+
* // cmd.exe: "set VAR1=val1 && set VAR2=val2 && command"
|
|
37
|
+
* buildEnvPrefix({ VAR1: "val1", VAR2: "val2" }, "cmd")
|
|
38
|
+
* // => "set VAR1=\"val1\" && set VAR2=\"val2\" &&"
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function buildEnvPrefix(env: Record<string, string>, shellType: ShellType): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Unified system directive prefix for oh-my-opencode internal messages.
|
|
3
|
+
* All system-generated messages should use this prefix for consistent filtering.
|
|
4
|
+
*
|
|
5
|
+
* Format: [SYSTEM DIRECTIVE: OH-MY-OPENCODE - {TYPE}]
|
|
6
|
+
*/
|
|
7
|
+
export declare const SYSTEM_DIRECTIVE_PREFIX = "[SYSTEM DIRECTIVE: OH-MY-OPENCODE";
|
|
8
|
+
/**
|
|
9
|
+
* Creates a system directive header with the given type.
|
|
10
|
+
* @param type - The directive type (e.g., "TODO CONTINUATION", "RALPH LOOP")
|
|
11
|
+
* @returns Formatted directive string like "[SYSTEM DIRECTIVE: OH-MY-OPENCODE - TODO CONTINUATION]"
|
|
12
|
+
*/
|
|
13
|
+
export declare function createSystemDirective(type: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Checks if a message starts with the oh-my-opencode system directive prefix.
|
|
16
|
+
* Used by keyword-detector and other hooks to skip system-generated messages.
|
|
17
|
+
* @param text - The message text to check
|
|
18
|
+
* @returns true if the message is a system directive
|
|
19
|
+
*/
|
|
20
|
+
export declare function isSystemDirective(text: string): boolean;
|
|
21
|
+
export declare const SystemDirectiveTypes: {
|
|
22
|
+
readonly TODO_CONTINUATION: "TODO CONTINUATION";
|
|
23
|
+
readonly RALPH_LOOP: "RALPH LOOP";
|
|
24
|
+
readonly BOULDER_CONTINUATION: "BOULDER CONTINUATION";
|
|
25
|
+
readonly DELEGATION_REQUIRED: "DELEGATION REQUIRED";
|
|
26
|
+
readonly SINGLE_TASK_ONLY: "SINGLE TASK ONLY";
|
|
27
|
+
readonly COMPACTION_CONTEXT: "COMPACTION CONTEXT";
|
|
28
|
+
readonly CONTEXT_WINDOW_MONITOR: "CONTEXT WINDOW MONITOR";
|
|
29
|
+
readonly PROMETHEUS_READ_ONLY: "PROMETHEUS READ-ONLY";
|
|
30
|
+
};
|
|
31
|
+
export type SystemDirectiveType = (typeof SystemDirectiveTypes)[keyof typeof SystemDirectiveTypes];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function extractZip(archivePath: string, destDir: string): Promise<void>;
|
|
@@ -2,11 +2,11 @@ import type { CategoryConfig } from "../../config/schema";
|
|
|
2
2
|
export declare const VISUAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on VISUAL/UI tasks.\n\nDesign-first mindset:\n- Bold aesthetic choices over safe defaults\n- Unexpected layouts, asymmetry, grid-breaking elements\n- Distinctive typography (avoid: Arial, Inter, Roboto, Space Grotesk)\n- Cohesive color palettes with sharp accents\n- High-impact animations with staggered reveals\n- Atmosphere: gradient meshes, noise textures, layered transparencies\n\nAVOID: Generic fonts, purple gradients on white, predictable layouts, cookie-cutter patterns.\n</Category_Context>";
|
|
3
3
|
export declare const STRATEGIC_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on BUSINESS LOGIC / ARCHITECTURE tasks.\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>";
|
|
4
4
|
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>";
|
|
5
|
-
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>\
|
|
5
|
+
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>";
|
|
6
6
|
export declare const MOST_CAPABLE_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on COMPLEX / MOST-CAPABLE tasks.\n\nMaximum capability mindset:\n- Bring full reasoning power to bear\n- Consider all edge cases and implications\n- Deep analysis before action\n- Quality over speed\n\nApproach:\n- Thorough understanding first\n- Comprehensive solution design\n- Meticulous execution\n- This is for the most challenging problems\n</Category_Context>";
|
|
7
7
|
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</Category_Context>";
|
|
8
|
-
export declare const GENERAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on GENERAL tasks.\n\nBalanced execution mindset:\n- Practical, straightforward approach\n- Good enough is good enough\n- Focus on getting things done\n\nApproach:\n- Standard best practices\n- Reasonable trade-offs\n- Efficient completion\n</Category_Context>\n\n<Caller_Warning>\
|
|
8
|
+
export declare const GENERAL_CATEGORY_PROMPT_APPEND = "<Category_Context>\nYou are working on GENERAL tasks.\n\nBalanced execution mindset:\n- Practical, straightforward approach\n- Good enough is good enough\n- Focus on getting things done\n\nApproach:\n- Standard best practices\n- Reasonable trade-offs\n- Efficient completion\n</Category_Context>\n\n<Caller_Warning>\nTHIS CATEGORY USES A MID-TIER MODEL (claude-sonnet-4-5).\n\nWhile capable, this model benefits significantly from EXPLICIT instructions.\n\n**PROVIDE CLEAR STRUCTURE:**\n1. MUST DO: Enumerate required actions explicitly - don't assume inference\n2. MUST NOT DO: State forbidden actions to prevent scope creep or wrong approaches\n3. EXPECTED OUTPUT: Define concrete success criteria and deliverables\n\n**COMMON PITFALLS WITHOUT EXPLICIT INSTRUCTIONS:**\n- Model may take shortcuts that miss edge cases\n- Implicit requirements get overlooked\n- Output format may not match expectations\n- Scope may expand beyond intended boundaries\n\n**RECOMMENDED PROMPT PATTERN:**\n```\nTASK: [Clear, single-purpose goal]\n\nCONTEXT: [Relevant background the model needs]\n\nMUST DO:\n- [Explicit requirement 1]\n- [Explicit requirement 2]\n\nMUST NOT DO:\n- [Boundary/constraint 1]\n- [Boundary/constraint 2]\n\nEXPECTED OUTPUT:\n- [What success looks like]\n- [How to verify completion]\n```\n\nThe more explicit your prompt, the better the results.\n</Caller_Warning>";
|
|
9
9
|
export declare const DEFAULT_CATEGORIES: Record<string, CategoryConfig>;
|
|
10
10
|
export declare const CATEGORY_PROMPT_APPENDS: Record<string, string>;
|
|
11
11
|
export declare const CATEGORY_DESCRIPTIONS: Record<string, string>;
|
|
12
|
-
export declare const
|
|
12
|
+
export declare const DELEGATE_TASK_DESCRIPTION: string;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { BackgroundManager } from "../../features/background-agent";
|
|
3
|
-
import type { CategoriesConfig } from "../../config/schema";
|
|
3
|
+
import type { CategoriesConfig, GitMasterConfig } from "../../config/schema";
|
|
4
4
|
type OpencodeClient = PluginInput["client"];
|
|
5
|
-
export interface
|
|
5
|
+
export interface DelegateTaskToolOptions {
|
|
6
6
|
manager: BackgroundManager;
|
|
7
7
|
client: OpencodeClient;
|
|
8
|
+
directory: string;
|
|
8
9
|
userCategories?: CategoriesConfig;
|
|
10
|
+
gitMasterConfig?: GitMasterConfig;
|
|
9
11
|
}
|
|
10
12
|
export interface BuildSystemContentInput {
|
|
11
13
|
skillContent?: string;
|
|
12
14
|
categoryPromptAppend?: string;
|
|
13
15
|
}
|
|
14
16
|
export declare function buildSystemContent(input: BuildSystemContentInput): string | undefined;
|
|
15
|
-
export declare function
|
|
17
|
+
export declare function createDelegateTask(options: DelegateTaskToolOptions): ToolDefinition;
|
|
16
18
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/glob/cli.d.ts
CHANGED
|
@@ -4,4 +4,8 @@ export interface ResolvedCli {
|
|
|
4
4
|
path: string;
|
|
5
5
|
backend: GrepBackend;
|
|
6
6
|
}
|
|
7
|
+
declare function buildRgArgs(options: GlobOptions): string[];
|
|
8
|
+
declare function buildFindArgs(options: GlobOptions): string[];
|
|
9
|
+
declare function buildPowerShellCommand(options: GlobOptions): string[];
|
|
10
|
+
export { buildRgArgs, buildFindArgs, buildPowerShellCommand };
|
|
7
11
|
export declare function runRgFiles(options: GlobOptions, resolvedCli?: ResolvedCli): Promise<GlobResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/tools/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { lspManager } from "./lsp";
|
|
2
|
+
export { lspManager };
|
|
1
3
|
export { createSlashcommandTool, discoverCommandsSync } from "./slashcommand";
|
|
2
4
|
export { sessionExists } from "./session-manager/storage";
|
|
3
5
|
export { interactive_bash, startBackgroundCheck as startTmuxCheck } from "./interactive-bash";
|
|
@@ -9,6 +11,6 @@ import type { BackgroundManager } from "../features/background-agent";
|
|
|
9
11
|
type OpencodeClient = PluginInput["client"];
|
|
10
12
|
export { createCallOmoAgent } from "./call-omo-agent";
|
|
11
13
|
export { createLookAt } from "./look-at";
|
|
12
|
-
export {
|
|
14
|
+
export { createDelegateTask, type DelegateTaskToolOptions, DEFAULT_CATEGORIES, CATEGORY_PROMPT_APPENDS } from "./delegate-task";
|
|
13
15
|
export declare function createBackgroundTools(manager: BackgroundManager, client: OpencodeClient): Record<string, ToolDefinition>;
|
|
14
16
|
export declare const builtinTools: Record<string, ToolDefinition>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export declare const DEFAULT_TIMEOUT_MS = 60000;
|
|
2
2
|
export declare const BLOCKED_TMUX_SUBCOMMANDS: string[];
|
|
3
|
-
export declare const INTERACTIVE_BASH_DESCRIPTION = "
|
|
3
|
+
export declare const INTERACTIVE_BASH_DESCRIPTION = "WARNING: This is TMUX ONLY. Pass tmux subcommands directly (without 'tmux' prefix).\n\nExamples: new-session -d -s omo-dev, send-keys -t omo-dev \"vim\" Enter\n\nFor TUI apps needing ongoing interaction (vim, htop, pudb). One-shot commands \u2192 use Bash with &.";
|
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import { type PluginInput, type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
|
+
import type { LookAtArgs } from "./types";
|
|
3
|
+
interface LookAtArgsWithAlias extends LookAtArgs {
|
|
4
|
+
path?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function normalizeArgs(args: LookAtArgsWithAlias): LookAtArgs;
|
|
7
|
+
export declare function validateArgs(args: LookAtArgs): string | null;
|
|
2
8
|
export declare function createLookAt(ctx: PluginInput): ToolDefinition;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -15,6 +15,7 @@ declare class LSPServerManager {
|
|
|
15
15
|
releaseClient(root: string, serverId: string): void;
|
|
16
16
|
isServerInitializing(root: string, serverId: string): boolean;
|
|
17
17
|
stopAll(): Promise<void>;
|
|
18
|
+
cleanupTempDirectoryClients(): Promise<void>;
|
|
18
19
|
}
|
|
19
20
|
export declare const lspManager: LSPServerManager;
|
|
20
21
|
export declare class LSPClient {
|
|
@@ -41,7 +42,6 @@ export declare class LSPClient {
|
|
|
41
42
|
private handleServerRequest;
|
|
42
43
|
initialize(): Promise<void>;
|
|
43
44
|
openFile(filePath: string): Promise<void>;
|
|
44
|
-
hover(filePath: string, line: number, character: number): Promise<unknown>;
|
|
45
45
|
definition(filePath: string, line: number, character: number): Promise<unknown>;
|
|
46
46
|
references(filePath: string, line: number, character: number, includeDeclaration?: boolean): Promise<unknown>;
|
|
47
47
|
documentSymbols(filePath: string): Promise<unknown>;
|
|
@@ -51,8 +51,6 @@ export declare class LSPClient {
|
|
|
51
51
|
}>;
|
|
52
52
|
prepareRename(filePath: string, line: number, character: number): Promise<unknown>;
|
|
53
53
|
rename(filePath: string, line: number, character: number, newName: string): Promise<unknown>;
|
|
54
|
-
codeAction(filePath: string, startLine: number, startChar: number, endLine: number, endChar: number, only?: string[]): Promise<unknown>;
|
|
55
|
-
codeActionResolve(codeAction: unknown): Promise<unknown>;
|
|
56
54
|
isAlive(): boolean;
|
|
57
55
|
stop(): Promise<void>;
|
|
58
56
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin/tool";
|
|
2
|
-
export declare const lsp_hover: ToolDefinition;
|
|
3
2
|
export declare const lsp_goto_definition: ToolDefinition;
|
|
4
3
|
export declare const lsp_find_references: ToolDefinition;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const lsp_workspace_symbols: ToolDefinition;
|
|
4
|
+
export declare const lsp_symbols: ToolDefinition;
|
|
7
5
|
export declare const lsp_diagnostics: ToolDefinition;
|
|
8
|
-
export declare const lsp_servers: ToolDefinition;
|
|
9
6
|
export declare const lsp_prepare_rename: ToolDefinition;
|
|
10
7
|
export declare const lsp_rename: ToolDefinition;
|
|
11
|
-
export declare const lsp_code_actions: ToolDefinition;
|
|
12
|
-
export declare const lsp_code_action_resolve: ToolDefinition;
|
|
@@ -44,16 +44,6 @@ export interface Diagnostic {
|
|
|
44
44
|
source?: string;
|
|
45
45
|
message: string;
|
|
46
46
|
}
|
|
47
|
-
export interface HoverResult {
|
|
48
|
-
contents: {
|
|
49
|
-
kind?: string;
|
|
50
|
-
value: string;
|
|
51
|
-
} | string | Array<{
|
|
52
|
-
kind?: string;
|
|
53
|
-
value: string;
|
|
54
|
-
} | string>;
|
|
55
|
-
range?: Range;
|
|
56
|
-
}
|
|
57
47
|
export interface TextDocumentIdentifier {
|
|
58
48
|
uri: string;
|
|
59
49
|
}
|
|
@@ -106,29 +96,6 @@ export interface PrepareRenameResult {
|
|
|
106
96
|
export interface PrepareRenameDefaultBehavior {
|
|
107
97
|
defaultBehavior: boolean;
|
|
108
98
|
}
|
|
109
|
-
export interface Command {
|
|
110
|
-
title: string;
|
|
111
|
-
command: string;
|
|
112
|
-
arguments?: unknown[];
|
|
113
|
-
}
|
|
114
|
-
export interface CodeActionContext {
|
|
115
|
-
diagnostics: Diagnostic[];
|
|
116
|
-
only?: string[];
|
|
117
|
-
triggerKind?: CodeActionTriggerKind;
|
|
118
|
-
}
|
|
119
|
-
export type CodeActionTriggerKind = 1 | 2;
|
|
120
|
-
export interface CodeAction {
|
|
121
|
-
title: string;
|
|
122
|
-
kind?: string;
|
|
123
|
-
diagnostics?: Diagnostic[];
|
|
124
|
-
isPreferred?: boolean;
|
|
125
|
-
disabled?: {
|
|
126
|
-
reason: string;
|
|
127
|
-
};
|
|
128
|
-
edit?: WorkspaceEdit;
|
|
129
|
-
command?: Command;
|
|
130
|
-
data?: unknown;
|
|
131
|
-
}
|
|
132
99
|
export interface ServerLookupInfo {
|
|
133
100
|
id: string;
|
|
134
101
|
command: string[];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { LSPClient } from "./client";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Location, LocationLink, DocumentSymbol, SymbolInfo, Diagnostic, PrepareRenameResult, PrepareRenameDefaultBehavior, Range, WorkspaceEdit, TextEdit, ServerLookupResult } from "./types";
|
|
3
3
|
export declare function findWorkspaceRoot(filePath: string): string;
|
|
4
4
|
export declare function uriToPath(uri: string): string;
|
|
5
5
|
export declare function formatServerLookupError(result: Exclude<ServerLookupResult, {
|
|
6
6
|
status: "found";
|
|
7
7
|
}>): string;
|
|
8
8
|
export declare function withLspClient<T>(filePath: string, fn: (client: LSPClient) => Promise<T>): Promise<T>;
|
|
9
|
-
export declare function formatHoverResult(result: HoverResult | null): string;
|
|
10
9
|
export declare function formatLocation(loc: Location | LocationLink): string;
|
|
11
10
|
export declare function formatSymbolKind(kind: number): string;
|
|
12
11
|
export declare function formatSeverity(severity: number | undefined): string;
|
|
@@ -17,8 +16,6 @@ export declare function filterDiagnosticsBySeverity(diagnostics: Diagnostic[], s
|
|
|
17
16
|
export declare function formatPrepareRenameResult(result: PrepareRenameResult | PrepareRenameDefaultBehavior | Range | null): string;
|
|
18
17
|
export declare function formatTextEdit(edit: TextEdit): string;
|
|
19
18
|
export declare function formatWorkspaceEdit(edit: WorkspaceEdit | null): string;
|
|
20
|
-
export declare function formatCodeAction(action: CodeAction): string;
|
|
21
|
-
export declare function formatCodeActions(actions: (CodeAction | Command)[] | null): string;
|
|
22
19
|
export interface ApplyResult {
|
|
23
20
|
success: boolean;
|
|
24
21
|
filesModified: string[];
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
2
2
|
import type { SkillLoadOptions } from "./types";
|
|
3
3
|
export declare function createSkillTool(options?: SkillLoadOptions): ToolDefinition;
|
|
4
|
-
export declare const skill:
|
|
5
|
-
description: string;
|
|
6
|
-
args: Readonly<{
|
|
7
|
-
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
8
|
-
}>;
|
|
9
|
-
execute(args: Record<string, unknown>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
10
|
-
};
|
|
4
|
+
export declare const skill: ToolDefinition;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { SkillScope, LoadedSkill } from "../../features/opencode-skill-loader/types";
|
|
2
2
|
import type { SkillMcpManager } from "../../features/skill-mcp-manager";
|
|
3
|
+
import type { GitMasterConfig } from "../../config/schema";
|
|
3
4
|
export interface SkillArgs {
|
|
4
5
|
name: string;
|
|
5
6
|
}
|
|
@@ -22,4 +23,6 @@ export interface SkillLoadOptions {
|
|
|
22
23
|
mcpManager?: SkillMcpManager;
|
|
23
24
|
/** Session ID getter for MCP client identification */
|
|
24
25
|
getSessionID?: () => string;
|
|
26
|
+
/** Git master configuration for watermark/co-author settings */
|
|
27
|
+
gitMasterConfig?: GitMasterConfig;
|
|
25
28
|
}
|
|
@@ -2,10 +2,4 @@ import { type ToolDefinition } from "@opencode-ai/plugin";
|
|
|
2
2
|
import type { CommandInfo, SlashcommandToolOptions } from "./types";
|
|
3
3
|
export declare function discoverCommandsSync(): CommandInfo[];
|
|
4
4
|
export declare function createSlashcommandTool(options?: SlashcommandToolOptions): ToolDefinition;
|
|
5
|
-
export declare const slashcommand:
|
|
6
|
-
description: string;
|
|
7
|
-
args: Readonly<{
|
|
8
|
-
[k: string]: import("zod/v4/core").$ZodType<unknown, unknown, import("zod/v4/core").$ZodTypeInternals<unknown, unknown>>;
|
|
9
|
-
}>;
|
|
10
|
-
execute(args: Record<string, unknown>, context: import("@opencode-ai/plugin").ToolContext): Promise<string>;
|
|
11
|
-
};
|
|
5
|
+
export declare const slashcommand: ToolDefinition;
|