oh-my-opencode 3.16.0 → 3.17.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.md +2 -0
- package/dist/agents/gpt-apply-patch-guard.d.ts +2 -0
- package/dist/agents/hephaestus/gpt-5-3-codex.d.ts +0 -1
- package/dist/cli/doctor/checks/system.d.ts +15 -2
- package/dist/cli/doctor/constants.d.ts +1 -1
- package/dist/cli/doctor/spawn-with-timeout.d.ts +8 -0
- package/dist/cli/index.js +5959 -942
- package/dist/create-tools.d.ts +2 -1
- package/dist/features/builtin-commands/commands.d.ts +2 -1
- package/dist/features/skill-mcp-manager/connection.d.ts +3 -4
- package/dist/features/skill-mcp-manager/http-client.d.ts +17 -3
- package/dist/features/skill-mcp-manager/manager.d.ts +2 -3
- package/dist/features/skill-mcp-manager/stdio-client.d.ts +16 -3
- package/dist/features/skill-mcp-manager/types.d.ts +16 -6
- package/dist/features/tmux-subagent/manager.d.ts +1 -0
- package/dist/hooks/atlas/session-last-agent.d.ts +10 -1
- package/dist/hooks/auto-update-checker/constants.d.ts +15 -0
- package/dist/hooks/auto-update-checker/hook.d.ts +22 -1
- package/dist/hooks/comment-checker/cli-runner.d.ts +4 -1
- package/dist/hooks/keyword-detector/hook.d.ts +1 -1
- package/dist/hooks/read-image-resizer/image-resizer.d.ts +3 -1
- package/dist/hooks/rules-injector/injector.d.ts +12 -0
- package/dist/index.js +7586 -1143
- package/dist/openclaw/config.d.ts +1 -1
- package/dist/openclaw/dispatcher.d.ts +3 -13
- package/dist/openclaw/gateway-url-validation.d.ts +1 -0
- package/dist/openclaw/reply-listener-discord.d.ts +4 -0
- package/dist/openclaw/reply-listener-injection.d.ts +10 -0
- package/dist/openclaw/reply-listener-log.d.ts +2 -0
- package/dist/openclaw/reply-listener-paths.d.ts +7 -0
- package/dist/openclaw/reply-listener-process.d.ts +4 -0
- package/dist/openclaw/reply-listener-spawn.d.ts +5 -0
- package/dist/openclaw/reply-listener-startup.d.ts +12 -0
- package/dist/openclaw/reply-listener-state.d.ts +29 -0
- package/dist/openclaw/reply-listener-telegram.d.ts +4 -0
- package/dist/openclaw/reply-listener.d.ts +5 -18
- package/dist/openclaw/runtime-dispatch.d.ts +17 -0
- package/dist/openclaw/types.d.ts +4 -0
- package/dist/plugin/command-execute-before.d.ts +3 -1
- package/dist/plugin/tool-registry.d.ts +23 -0
- package/dist/plugin-handlers/agent-priority-order.d.ts +11 -0
- package/dist/shared/agent-display-names.d.ts +5 -0
- package/dist/shared/compaction-marker.d.ts +1 -0
- package/dist/shared/migration/migrations-sidecar.d.ts +41 -0
- package/dist/shared/plugin-identity.d.ts +2 -0
- package/dist/shared/posthog-activity-state.d.ts +8 -0
- package/dist/shared/posthog.d.ts +14 -0
- package/dist/shared/shell-env.d.ts +6 -2
- package/dist/testing/module-mock-lifecycle.d.ts +21 -0
- package/dist/tools/session-manager/tools.d.ts +19 -1
- package/package.json +13 -12
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OpenClawConfig, OpenClawGateway } from "./types";
|
|
2
|
+
export { validateGatewayUrl } from "./gateway-url-validation";
|
|
2
3
|
export declare function normalizeReplyListenerConfig(config: OpenClawConfig): OpenClawConfig;
|
|
3
4
|
export declare function resolveGateway(config: OpenClawConfig, event: string): {
|
|
4
5
|
gatewayName: string;
|
|
5
6
|
gateway: OpenClawGateway;
|
|
6
7
|
instruction: string;
|
|
7
8
|
} | null;
|
|
8
|
-
export declare function validateGatewayUrl(url: string): boolean;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
import type { OpenClawGateway } from "./types";
|
|
2
|
-
export declare function validateGatewayUrl(url: string): boolean;
|
|
1
|
+
import type { OpenClawGateway, WakeResult } from "./types";
|
|
3
2
|
export declare function interpolateInstruction(template: string, variables: Record<string, string | undefined>): string;
|
|
4
3
|
export declare function shellEscapeArg(value: string): string;
|
|
5
4
|
export declare function resolveCommandTimeoutMs(gatewayTimeout?: number, envTimeoutRaw?: string | undefined): number;
|
|
6
|
-
export declare function wakeGateway(gatewayName: string, gatewayConfig: OpenClawGateway, payload: unknown): Promise<
|
|
7
|
-
|
|
8
|
-
success: boolean;
|
|
9
|
-
error?: string;
|
|
10
|
-
statusCode?: number;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function wakeCommandGateway(gatewayName: string, gatewayConfig: OpenClawGateway, variables: Record<string, string | undefined>): Promise<{
|
|
13
|
-
gateway: string;
|
|
14
|
-
success: boolean;
|
|
15
|
-
error?: string;
|
|
16
|
-
}>;
|
|
5
|
+
export declare function wakeGateway(gatewayName: string, gatewayConfig: OpenClawGateway, payload: unknown): Promise<WakeResult>;
|
|
6
|
+
export declare function wakeCommandGateway(gatewayName: string, gatewayConfig: OpenClawGateway, variables: Record<string, string | undefined>): Promise<WakeResult>;
|
|
17
7
|
type KillableProcess = {
|
|
18
8
|
pid?: number;
|
|
19
9
|
kill: (signal?: NodeJS.Signals) => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function validateGatewayUrl(url: string): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReplyListenerRateLimiter } from "./reply-listener-injection";
|
|
2
|
+
import { type ReplyListenerDaemonState } from "./reply-listener-state";
|
|
3
|
+
import type { OpenClawConfig } from "./types";
|
|
4
|
+
export declare function pollDiscordReplies(config: OpenClawConfig, state: ReplyListenerDaemonState, rateLimiter: ReplyListenerRateLimiter): Promise<void>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenClawConfig } from "./types";
|
|
2
|
+
export declare function sanitizeReplyInput(text: string): string;
|
|
3
|
+
export declare class ReplyListenerRateLimiter {
|
|
4
|
+
private readonly maxPerMinute;
|
|
5
|
+
private readonly timestamps;
|
|
6
|
+
private readonly windowMs;
|
|
7
|
+
constructor(maxPerMinute: number);
|
|
8
|
+
canProceed(): boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function injectReplyIntoPane(paneId: string, text: string, platform: string, config: OpenClawConfig): Promise<boolean>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const REPLY_LISTENER_SECURE_FILE_MODE = 384;
|
|
2
|
+
export declare function getReplyListenerStateDir(): string;
|
|
3
|
+
export declare function getReplyListenerPidFilePath(): string;
|
|
4
|
+
export declare function getReplyListenerStateFilePath(): string;
|
|
5
|
+
export declare function getReplyListenerConfigFilePath(): string;
|
|
6
|
+
export declare function getReplyListenerLogFilePath(): string;
|
|
7
|
+
export declare function ensureReplyListenerStateDir(): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const REPLY_LISTENER_DAEMON_IDENTITY_MARKER = "--openclaw-reply-listener-daemon";
|
|
2
|
+
export declare function createReplyListenerDaemonEnv(extraEnv: Record<string, string>): Record<string, string>;
|
|
3
|
+
export declare function isReplyListenerProcessRunning(pid: number): boolean;
|
|
4
|
+
export declare function isReplyListenerDaemonProcess(pid: number): Promise<boolean>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReplyListenerDaemonState } from "./reply-listener-state";
|
|
2
|
+
interface WaitForReplyListenerReadyOptions {
|
|
3
|
+
pid: number;
|
|
4
|
+
startupToken: string;
|
|
5
|
+
timeoutMs: number;
|
|
6
|
+
readState: () => ReplyListenerDaemonState | null;
|
|
7
|
+
sleep: (ms: number) => Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createReplyListenerStartupToken(): string;
|
|
10
|
+
export declare function getReplyListenerStartupTimeoutMs(): number;
|
|
11
|
+
export declare function waitForReplyListenerReady(options: WaitForReplyListenerReadyOptions): Promise<ReplyListenerDaemonState | null>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { OpenClawConfig } from "./types";
|
|
2
|
+
export declare const REPLY_LISTENER_STARTUP_TOKEN_ENV = "OMO_OPENCLAW_REPLY_LISTENER_STARTUP_TOKEN";
|
|
3
|
+
export interface ReplyListenerDaemonState {
|
|
4
|
+
isRunning: boolean;
|
|
5
|
+
pid: number | null;
|
|
6
|
+
startedAt: string;
|
|
7
|
+
startupToken: string | null;
|
|
8
|
+
configSignature: string | null;
|
|
9
|
+
lastPollAt: string | null;
|
|
10
|
+
telegramLastUpdateId: number | null;
|
|
11
|
+
discordLastMessageId: string | null;
|
|
12
|
+
lastDiscordMessageId: string | null;
|
|
13
|
+
messagesSeen: number;
|
|
14
|
+
messagesInjected: number;
|
|
15
|
+
errors: number;
|
|
16
|
+
lastError?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createPendingReplyListenerState(startupToken: string): ReplyListenerDaemonState;
|
|
19
|
+
export declare function readReplyListenerDaemonState(): ReplyListenerDaemonState | null;
|
|
20
|
+
export declare function writeReplyListenerDaemonState(state: ReplyListenerDaemonState): void;
|
|
21
|
+
export declare function readReplyListenerDaemonConfig(): OpenClawConfig | null;
|
|
22
|
+
export declare function writeReplyListenerDaemonConfig(config: OpenClawConfig): void;
|
|
23
|
+
export declare function readReplyListenerPid(): number | null;
|
|
24
|
+
export declare function writeReplyListenerPid(pid: number): void;
|
|
25
|
+
export declare function removeReplyListenerPid(): void;
|
|
26
|
+
export declare function getReplyListenerStartupTokenFromEnv(): string | null;
|
|
27
|
+
export declare function recordReplyListenerPoll(state: ReplyListenerDaemonState, pid: number): void;
|
|
28
|
+
export declare function recordSeenDiscordMessage(state: ReplyListenerDaemonState, messageId: string): void;
|
|
29
|
+
export declare function markReplyListenerStopped(state: ReplyListenerDaemonState | null, error?: string): ReplyListenerDaemonState;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ReplyListenerRateLimiter } from "./reply-listener-injection";
|
|
2
|
+
import { type ReplyListenerDaemonState } from "./reply-listener-state";
|
|
3
|
+
import type { OpenClawConfig } from "./types";
|
|
4
|
+
export declare function pollTelegramReplies(config: OpenClawConfig, state: ReplyListenerDaemonState, rateLimiter: ReplyListenerRateLimiter): Promise<void>;
|
|
@@ -1,31 +1,18 @@
|
|
|
1
|
+
import { logReplyListenerMessage } from "./reply-listener-log";
|
|
2
|
+
import { type ReplyListenerDaemonState } from "./reply-listener-state";
|
|
1
3
|
import type { OpenClawConfig } from "./types";
|
|
2
|
-
export declare const DAEMON_IDENTITY_MARKER = "--openclaw-reply-listener-daemon";
|
|
3
|
-
export declare function logReplyListenerMessage(message: string): void;
|
|
4
|
-
interface DaemonState {
|
|
5
|
-
isRunning: boolean;
|
|
6
|
-
pid: number | null;
|
|
7
|
-
startedAt: string;
|
|
8
|
-
lastPollAt: string | null;
|
|
9
|
-
telegramLastUpdateId: number | null;
|
|
10
|
-
discordLastMessageId: string | null;
|
|
11
|
-
messagesInjected: number;
|
|
12
|
-
errors: number;
|
|
13
|
-
lastError?: string;
|
|
14
|
-
}
|
|
15
|
-
export declare function isReplyListenerProcess(pid: number): Promise<boolean>;
|
|
16
4
|
export declare function isDaemonRunning(): Promise<boolean>;
|
|
17
|
-
export declare function sanitizeReplyInput(text: string): string;
|
|
18
5
|
export declare function pollLoop(): Promise<void>;
|
|
19
6
|
export declare function startReplyListener(config: OpenClawConfig): Promise<{
|
|
20
7
|
success: boolean;
|
|
21
8
|
message: string;
|
|
22
|
-
state?:
|
|
9
|
+
state?: ReplyListenerDaemonState;
|
|
23
10
|
error?: string;
|
|
24
11
|
}>;
|
|
25
12
|
export declare function stopReplyListener(): Promise<{
|
|
26
13
|
success: boolean;
|
|
27
14
|
message: string;
|
|
28
|
-
state?:
|
|
15
|
+
state?: ReplyListenerDaemonState;
|
|
29
16
|
error?: string;
|
|
30
17
|
}>;
|
|
31
|
-
export {};
|
|
18
|
+
export { logReplyListenerMessage };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { OpenClawConfig, WakeResult } from "./types";
|
|
2
|
+
interface DispatchOpenClawContext {
|
|
3
|
+
sessionId?: string;
|
|
4
|
+
projectPath?: string;
|
|
5
|
+
tmuxPaneId?: string;
|
|
6
|
+
tmuxSession?: string;
|
|
7
|
+
replyChannel?: string;
|
|
8
|
+
replyTarget?: string;
|
|
9
|
+
replyThread?: string;
|
|
10
|
+
}
|
|
11
|
+
interface DispatchOpenClawEventParams {
|
|
12
|
+
config: OpenClawConfig;
|
|
13
|
+
rawEvent: string;
|
|
14
|
+
context: DispatchOpenClawContext;
|
|
15
|
+
}
|
|
16
|
+
export declare function dispatchOpenClawEvent(params: DispatchOpenClawEventParams): Promise<WakeResult | null>;
|
|
17
|
+
export {};
|
package/dist/openclaw/types.d.ts
CHANGED
|
@@ -10,8 +10,10 @@ type CommandExecuteBeforeOutput = {
|
|
|
10
10
|
text?: string;
|
|
11
11
|
[key: string]: unknown;
|
|
12
12
|
}>;
|
|
13
|
+
message?: Record<string, unknown>;
|
|
13
14
|
};
|
|
15
|
+
declare const NATIVE_LOOP_TRIGGERED_FLAG = "__omoNativeLoopTriggered";
|
|
14
16
|
export declare function createCommandExecuteBeforeHandler(args: {
|
|
15
17
|
hooks: CreatedHooks;
|
|
16
18
|
}): (input: CommandExecuteBeforeInput, output: CommandExecuteBeforeOutput) => Promise<void>;
|
|
17
|
-
export {};
|
|
19
|
+
export { NATIVE_LOOP_TRIGGERED_FLAG };
|
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
import type { AvailableCategory } from "../agents/dynamic-agent-prompt-builder";
|
|
2
2
|
import type { OhMyOpenCodeConfig } from "../config";
|
|
3
3
|
import type { PluginContext, ToolsRecord } from "./types";
|
|
4
|
+
import { builtinTools, createBackgroundTools, createCallOmoAgent, createLookAt, createSkillMcpTool, createSkillTool, createGrepTools, createGlobTools, createAstGrepTools, createSessionManagerTools, createDelegateTask, discoverCommandsSync, interactive_bash, createTaskCreateTool, createTaskGetTool, createTaskList, createTaskUpdateTool, createHashlineEditTool } from "../tools";
|
|
4
5
|
import type { Managers } from "../create-managers";
|
|
5
6
|
import type { SkillContext } from "./skill-context";
|
|
7
|
+
type ToolRegistryFactories = {
|
|
8
|
+
builtinTools: typeof builtinTools;
|
|
9
|
+
createBackgroundTools: typeof createBackgroundTools;
|
|
10
|
+
createCallOmoAgent: typeof createCallOmoAgent;
|
|
11
|
+
createLookAt: typeof createLookAt;
|
|
12
|
+
createSkillMcpTool: typeof createSkillMcpTool;
|
|
13
|
+
createSkillTool: typeof createSkillTool;
|
|
14
|
+
createGrepTools: typeof createGrepTools;
|
|
15
|
+
createGlobTools: typeof createGlobTools;
|
|
16
|
+
createAstGrepTools: typeof createAstGrepTools;
|
|
17
|
+
createSessionManagerTools: typeof createSessionManagerTools;
|
|
18
|
+
createDelegateTask: typeof createDelegateTask;
|
|
19
|
+
discoverCommandsSync: typeof discoverCommandsSync;
|
|
20
|
+
interactive_bash: typeof interactive_bash;
|
|
21
|
+
createTaskCreateTool: typeof createTaskCreateTool;
|
|
22
|
+
createTaskGetTool: typeof createTaskGetTool;
|
|
23
|
+
createTaskList: typeof createTaskList;
|
|
24
|
+
createTaskUpdateTool: typeof createTaskUpdateTool;
|
|
25
|
+
createHashlineEditTool: typeof createHashlineEditTool;
|
|
26
|
+
};
|
|
6
27
|
export type ToolRegistryResult = {
|
|
7
28
|
filteredTools: ToolsRecord;
|
|
8
29
|
taskSystemEnabled: boolean;
|
|
@@ -15,4 +36,6 @@ export declare function createToolRegistry(args: {
|
|
|
15
36
|
skillContext: SkillContext;
|
|
16
37
|
availableCategories: AvailableCategory[];
|
|
17
38
|
interactiveBashEnabled?: boolean;
|
|
39
|
+
toolFactories?: Partial<ToolRegistryFactories>;
|
|
18
40
|
}): ToolRegistryResult;
|
|
41
|
+
export {};
|
|
@@ -1 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CRITICAL: This is the ONLY source of truth for core agent ordering.
|
|
3
|
+
* The order is: sisyphus → hephaestus → prometheus → atlas
|
|
4
|
+
*
|
|
5
|
+
* DO NOT CHANGE THIS ORDER. Any PR attempting to modify this order
|
|
6
|
+
* or introduce alternative ordering mechanisms (ZWSP prefixes, sort
|
|
7
|
+
* shims, etc.) will be rejected.
|
|
8
|
+
*
|
|
9
|
+
* See: src/plugin-handlers/AGENTS.md for architectural context.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CANONICAL_CORE_AGENT_ORDER: readonly ["sisyphus", "hephaestus", "prometheus", "atlas"];
|
|
1
12
|
export declare function reorderAgentsByPriority(agents: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -10,13 +10,18 @@
|
|
|
10
10
|
* type selector dropdown. Use ` - ` (space-dash-space) instead of `(...)`.
|
|
11
11
|
*/
|
|
12
12
|
export declare const AGENT_DISPLAY_NAMES: Record<string, string>;
|
|
13
|
+
export declare function stripInvisibleAgentCharacters(agentName: string): string;
|
|
13
14
|
export declare function stripAgentListSortPrefix(agentName: string): string;
|
|
15
|
+
export declare function getAgentRuntimeName(configKey: string): string;
|
|
14
16
|
/**
|
|
15
17
|
* Get display name for an agent config key.
|
|
16
18
|
* Uses case-insensitive lookup for backward compatibility.
|
|
17
19
|
* Returns original key if not found.
|
|
18
20
|
*/
|
|
19
21
|
export declare function getAgentDisplayName(configKey: string): string;
|
|
22
|
+
/**
|
|
23
|
+
* Runtime-facing agent name used for OpenCode list ordering.
|
|
24
|
+
*/
|
|
20
25
|
export declare function getAgentListDisplayName(configKey: string): string;
|
|
21
26
|
/**
|
|
22
27
|
* Resolve an agent name (display name or config key) to its lowercase config key.
|
|
@@ -8,5 +8,6 @@ type CompactionMessageLike = {
|
|
|
8
8
|
export declare function isCompactionAgent(agent: unknown): boolean;
|
|
9
9
|
export declare function hasCompactionPart(parts: unknown): boolean;
|
|
10
10
|
export declare function isCompactionMessage(message: CompactionMessageLike): boolean;
|
|
11
|
+
export declare function getCompactionPartStorageDir(messageID: string): string;
|
|
11
12
|
export declare function hasCompactionPartInStorage(messageID: string | undefined): boolean;
|
|
12
13
|
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sidecar state file that tracks applied config migrations outside the user's
|
|
3
|
+
* config file.
|
|
4
|
+
*
|
|
5
|
+
* Why this exists (#3263): users who revert an auto-migrated value (e.g.
|
|
6
|
+
* `gpt-5.4` → `gpt-5.3-codex`) and then delete the `_migrations` field from
|
|
7
|
+
* their config would fall into an infinite migration loop — every startup
|
|
8
|
+
* re-applied the migration because there was no memory of the previous
|
|
9
|
+
* application. The sidecar remembers applied migrations even when the user
|
|
10
|
+
* scrubs the config, and only "resets" when the user explicitly deletes both
|
|
11
|
+
* the config and the sidecar.
|
|
12
|
+
*
|
|
13
|
+
* The sidecar lives next to the config file as
|
|
14
|
+
* `<configFileName>.migrations.json`. One sidecar per config file. The file
|
|
15
|
+
* format is a flat JSON object:
|
|
16
|
+
*
|
|
17
|
+
* {
|
|
18
|
+
* "appliedMigrations": [
|
|
19
|
+
* "model-version:openai/gpt-5.3-codex->openai/gpt-5.4",
|
|
20
|
+
* "model-version:anthropic/claude-opus-4-5->anthropic/claude-opus-4-6"
|
|
21
|
+
* ]
|
|
22
|
+
* }
|
|
23
|
+
*/
|
|
24
|
+
export interface MigrationsSidecar {
|
|
25
|
+
appliedMigrations: string[];
|
|
26
|
+
}
|
|
27
|
+
export declare function getSidecarPath(configPath: string): string;
|
|
28
|
+
/**
|
|
29
|
+
* Read the set of applied migration keys from the sidecar next to
|
|
30
|
+
* `configPath`. Returns an empty set on any read or parse failure so the
|
|
31
|
+
* caller can still trust the return value and safely fall back to the
|
|
32
|
+
* config's `_migrations` field.
|
|
33
|
+
*/
|
|
34
|
+
export declare function readAppliedMigrations(configPath: string): Set<string>;
|
|
35
|
+
/**
|
|
36
|
+
* Persist the given set of applied migration keys to the sidecar next to
|
|
37
|
+
* `configPath`. The sidecar is written atomically. Returns true on success,
|
|
38
|
+
* false if the write failed (the caller can still proceed — the next
|
|
39
|
+
* startup will re-run the migration, which is idempotent by design).
|
|
40
|
+
*/
|
|
41
|
+
export declare function writeAppliedMigrations(configPath: string, migrations: Set<string>): boolean;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare const PLUGIN_NAME = "oh-my-openagent";
|
|
2
2
|
export declare const LEGACY_PLUGIN_NAME = "oh-my-opencode";
|
|
3
|
+
export declare const PUBLISHED_PACKAGE_NAME = "oh-my-opencode";
|
|
4
|
+
export declare const ACCEPTED_PACKAGE_NAMES: readonly ["oh-my-opencode", "oh-my-openagent"];
|
|
3
5
|
export declare const CONFIG_BASENAME = "oh-my-openagent";
|
|
4
6
|
export declare const LEGACY_CONFIG_BASENAME = "oh-my-opencode";
|
|
5
7
|
export declare const LOG_FILENAME = "oh-my-opencode.log";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { PostHog } from "posthog-node";
|
|
2
|
+
type PostHogCaptureEvent = Parameters<PostHog["capture"]>[0];
|
|
3
|
+
type PostHogExceptionProperties = Parameters<PostHog["captureException"]>[2];
|
|
4
|
+
type PostHogActivityReason = "run_started" | "plugin_loaded";
|
|
5
|
+
type PostHogClient = {
|
|
6
|
+
capture: (message: PostHogCaptureEvent) => void;
|
|
7
|
+
captureException: (error: unknown, distinctId?: string, additionalProperties?: PostHogExceptionProperties) => void;
|
|
8
|
+
trackActive: (distinctId: string, reason: PostHogActivityReason) => void;
|
|
9
|
+
shutdown: () => Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export declare function getPostHogDistinctId(): string;
|
|
12
|
+
export declare function createCliPostHog(): PostHogClient;
|
|
13
|
+
export declare function createPluginPostHog(): PostHogClient;
|
|
14
|
+
export {};
|
|
@@ -3,9 +3,13 @@ export type ShellType = "unix" | "powershell" | "cmd" | "csh";
|
|
|
3
3
|
* Detect the current shell type based on environment variables.
|
|
4
4
|
*
|
|
5
5
|
* Detection priority:
|
|
6
|
-
* 1.
|
|
7
|
-
* 2.
|
|
6
|
+
* 1. SHELL env var → Unix shell (explicit user choice takes precedence)
|
|
7
|
+
* 2. PSModulePath → PowerShell
|
|
8
8
|
* 3. Platform fallback → win32: cmd, others: unix
|
|
9
|
+
*
|
|
10
|
+
* Note: SHELL is checked before PSModulePath because on Windows, PSModulePath
|
|
11
|
+
* is always set by the system even when the active shell is Git Bash or WSL.
|
|
12
|
+
* An explicit SHELL variable indicates the user's chosen shell overrides that.
|
|
9
13
|
*/
|
|
10
14
|
export declare function detectShellType(): ShellType;
|
|
11
15
|
/**
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
type MockModuleFactory = () => Record<string, unknown>;
|
|
2
|
+
type MockApi = {
|
|
3
|
+
module: (specifier: string, factory: MockModuleFactory) => unknown;
|
|
4
|
+
restore: () => unknown;
|
|
5
|
+
};
|
|
6
|
+
type ModuleLoadResult = {
|
|
7
|
+
ok: true;
|
|
8
|
+
value: unknown;
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
11
|
+
error: Error;
|
|
12
|
+
};
|
|
13
|
+
type ModuleMockLifecycleOptions = {
|
|
14
|
+
getCallerUrl?: () => string;
|
|
15
|
+
resolveSpecifier?: (specifier: string, callerUrl: string) => string;
|
|
16
|
+
loadOriginalModule?: (specifier: string, callerUrl: string) => ModuleLoadResult;
|
|
17
|
+
};
|
|
18
|
+
export declare function installModuleMockLifecycle(mockApi: MockApi, options?: ModuleMockLifecycleOptions): {
|
|
19
|
+
restoreModuleMocks: () => void;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
2
|
import { type ToolDefinition } from "@opencode-ai/plugin/tool";
|
|
3
|
-
|
|
3
|
+
import { getAllSessions, getMainSessions, getSessionInfo, readSessionMessages, readSessionTodos, sessionExists, setStorageClient } from "./storage";
|
|
4
|
+
import { filterSessionsByDate, formatSessionInfo, formatSessionList, formatSessionMessages, formatSearchResults, searchInSession } from "./session-formatter";
|
|
5
|
+
type SessionManagerToolDeps = {
|
|
6
|
+
getAllSessions: typeof getAllSessions;
|
|
7
|
+
getMainSessions: typeof getMainSessions;
|
|
8
|
+
getSessionInfo: typeof getSessionInfo;
|
|
9
|
+
readSessionMessages: typeof readSessionMessages;
|
|
10
|
+
readSessionTodos: typeof readSessionTodos;
|
|
11
|
+
sessionExists: typeof sessionExists;
|
|
12
|
+
setStorageClient: typeof setStorageClient;
|
|
13
|
+
filterSessionsByDate: typeof filterSessionsByDate;
|
|
14
|
+
formatSessionInfo: typeof formatSessionInfo;
|
|
15
|
+
formatSessionList: typeof formatSessionList;
|
|
16
|
+
formatSessionMessages: typeof formatSessionMessages;
|
|
17
|
+
formatSearchResults: typeof formatSearchResults;
|
|
18
|
+
searchInSession: typeof searchInSession;
|
|
19
|
+
};
|
|
20
|
+
export declare function createSessionManagerTools(ctx: PluginInput, deps?: Partial<SessionManagerToolDeps>): Record<string, ToolDefinition>;
|
|
21
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oh-my-opencode",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.17.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",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"jsonc-parser": "^3.3.1",
|
|
69
69
|
"picocolors": "^1.1.1",
|
|
70
70
|
"picomatch": "^4.0.2",
|
|
71
|
+
"posthog-node": "^5.29.2",
|
|
71
72
|
"vscode-jsonrpc": "^8.2.0",
|
|
72
73
|
"zod": "^4.3.0"
|
|
73
74
|
},
|
|
@@ -78,17 +79,17 @@
|
|
|
78
79
|
"typescript": "^5.7.3"
|
|
79
80
|
},
|
|
80
81
|
"optionalDependencies": {
|
|
81
|
-
"oh-my-opencode-darwin-arm64": "3.
|
|
82
|
-
"oh-my-opencode-darwin-x64": "3.
|
|
83
|
-
"oh-my-opencode-darwin-x64-baseline": "3.
|
|
84
|
-
"oh-my-opencode-linux-arm64": "3.
|
|
85
|
-
"oh-my-opencode-linux-arm64-musl": "3.
|
|
86
|
-
"oh-my-opencode-linux-x64": "3.
|
|
87
|
-
"oh-my-opencode-linux-x64-baseline": "3.
|
|
88
|
-
"oh-my-opencode-linux-x64-musl": "3.
|
|
89
|
-
"oh-my-opencode-linux-x64-musl-baseline": "3.
|
|
90
|
-
"oh-my-opencode-windows-x64": "3.
|
|
91
|
-
"oh-my-opencode-windows-x64-baseline": "3.
|
|
82
|
+
"oh-my-opencode-darwin-arm64": "3.17.1",
|
|
83
|
+
"oh-my-opencode-darwin-x64": "3.17.1",
|
|
84
|
+
"oh-my-opencode-darwin-x64-baseline": "3.17.1",
|
|
85
|
+
"oh-my-opencode-linux-arm64": "3.17.1",
|
|
86
|
+
"oh-my-opencode-linux-arm64-musl": "3.17.1",
|
|
87
|
+
"oh-my-opencode-linux-x64": "3.17.1",
|
|
88
|
+
"oh-my-opencode-linux-x64-baseline": "3.17.1",
|
|
89
|
+
"oh-my-opencode-linux-x64-musl": "3.17.1",
|
|
90
|
+
"oh-my-opencode-linux-x64-musl-baseline": "3.17.1",
|
|
91
|
+
"oh-my-opencode-windows-x64": "3.17.1",
|
|
92
|
+
"oh-my-opencode-windows-x64-baseline": "3.17.1"
|
|
92
93
|
},
|
|
93
94
|
"overrides": {},
|
|
94
95
|
"trustedDependencies": [
|