oh-my-opencode 5.0.0-beta.12 → 5.0.0-beta.14
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/.agents/skills/senpi-qa/SKILL.md +80 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.mjs +65 -0
- package/.agents/skills/senpi-qa/scripts/resolve-evidence-dir.test.mjs +171 -0
- package/README.ja.md +25 -21
- package/README.ko.md +25 -21
- package/README.md +26 -22
- package/README.ru.md +24 -20
- package/README.zh-cn.md +25 -21
- package/dist/cli/index.js +16747 -15223
- package/dist/cli-node/index.js +16898 -15374
- package/dist/create-hooks.d.ts +1 -0
- package/dist/features/btw-side/btw-command-draft.d.ts +7 -0
- package/dist/features/btw-side/context-injector.d.ts +15 -0
- package/dist/features/btw-side/index.d.ts +8 -0
- package/dist/features/btw-side/metadata.d.ts +15 -0
- package/dist/features/btw-side/parent-context-budget.d.ts +9 -0
- package/dist/features/btw-side/server-session-registry.d.ts +8 -0
- package/dist/features/btw-side/tui-adoption-cache.d.ts +13 -0
- package/dist/features/btw-side/tui-adoption-guard.d.ts +5 -0
- package/dist/features/btw-side/tui-controller-types.d.ts +68 -0
- package/dist/features/btw-side/tui-controller.d.ts +19 -0
- package/dist/features/btw-side/tui-escape-return.d.ts +12 -0
- package/dist/features/btw-side/tui-keymap.d.ts +17 -0
- package/dist/features/btw-side/tui-parent-validator.d.ts +6 -0
- package/dist/features/btw-side/tui-picker-options.d.ts +20 -0
- package/dist/features/btw-side/tui-picker.d.ts +9 -0
- package/dist/features/btw-side/tui-prompt-queue.d.ts +8 -0
- package/dist/features/btw-side/tui-session-bridge.d.ts +11 -0
- package/dist/features/btw-side/tui-session-catalog.d.ts +35 -0
- package/dist/features/btw-side/tui-side-removal.d.ts +11 -0
- package/dist/features/btw-side/tui-side-start.d.ts +9 -0
- package/dist/features/btw-side/tui-wiring.d.ts +8 -0
- package/dist/features/opengateway-provider/index.d.ts +13 -0
- package/dist/hooks/runtime-fallback/chat-message-handler.d.ts +2 -0
- package/dist/hooks/runtime-fallback/retry-model-payload.d.ts +1 -0
- package/dist/hooks/runtime-fallback/runtime-model-settings.d.ts +6 -0
- package/dist/hooks/runtime-fallback/session-status-handler.d.ts +1 -1
- package/dist/hooks/runtime-fallback/types.d.ts +3 -1
- package/dist/index.js +10814 -6018
- package/dist/plugin/event-session-lifecycle.d.ts +1 -0
- package/dist/plugin/hooks/create-core-hooks.d.ts +1 -0
- package/dist/plugin/hooks/create-transform-hooks.d.ts +2 -0
- package/dist/plugin/messages-transform.d.ts +1 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/runtime-fallback-retry-marker.d.ts +16 -0
- package/dist/skills/frontend/SKILL.md +1 -0
- package/dist/skills/frontend/references/design/print-paged-media.md +76 -0
- package/dist/skills/ulw-research/SKILL.md +1 -1
- package/dist/skills/visual-qa/SKILL.md +3 -2
- package/dist/tui.js +8273 -8493
- package/package.json +30 -29
- package/packages/git-bash-mcp/dist/cli.js +5 -1
- package/packages/git-bash-mcp/package.json +1 -1
- package/packages/lsp-daemon/dist/cli.js +86 -114
- package/packages/lsp-daemon/dist/client.js +87 -118
- package/packages/lsp-daemon/dist/ensure-daemon.js +1 -0
- package/packages/lsp-daemon/dist/index.js +93 -123
- package/packages/lsp-daemon/dist/version-reap.js +1 -1
- package/packages/lsp-tools-mcp/dist/cli.js +67 -94
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +62 -92
- package/packages/lsp-tools-mcp/dist/mcp.js +69 -96
- package/packages/lsp-tools-mcp/dist/request-context.js +11 -12
- package/packages/lsp-tools-mcp/dist/tools.js +73 -104
- package/packages/omo-codex/plugin/.codex-plugin/plugin.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/dist/cli.js +30 -29
- package/packages/omo-codex/plugin/components/bootstrap/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/package.json +1 -1
- package/packages/omo-codex/plugin/components/bootstrap/src/hook.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/dist/cli.js +86 -65
- package/packages/omo-codex/plugin/components/codegraph/dist/serve.js +86 -66
- package/packages/omo-codex/plugin/components/codegraph/package.json +4 -4
- package/packages/omo-codex/plugin/components/codegraph/src/mcp-bridge.ts +1 -0
- package/packages/omo-codex/plugin/components/codegraph/src/session-start-hook-runtime.ts +1 -0
- package/packages/omo-codex/plugin/components/comment-checker/dist/cli.js +2 -1
- package/packages/omo-codex/plugin/components/comment-checker/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/comment-checker/package.json +5 -5
- package/packages/omo-codex/plugin/components/comment-checker/src/runner.ts +1 -0
- package/packages/omo-codex/plugin/components/git-bash/AGENTS.md +1 -1
- package/packages/omo-codex/plugin/components/git-bash/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/git-bash/package.json +3 -4
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/lazycodex-executor-verify/package.json +5 -5
- package/packages/omo-codex/plugin/components/lsp/dist/.omo-runtime-manifest.json +3 -3
- package/packages/omo-codex/plugin/components/lsp/dist/cli.js +70 -107
- package/packages/omo-codex/plugin/components/lsp/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/lsp/package.json +5 -5
- package/packages/omo-codex/plugin/components/lsp/src/cli.ts +1 -1
- package/packages/omo-codex/plugin/components/rules/dist/cli.js +14 -12
- package/packages/omo-codex/plugin/components/rules/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/rules/package.json +7 -7
- package/packages/omo-codex/plugin/components/start-work-continuation/hooks/hooks.json +2 -2
- package/packages/omo-codex/plugin/components/start-work-continuation/package.json +5 -5
- package/packages/omo-codex/plugin/components/teammode/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/teammode/package.json +5 -5
- package/packages/omo-codex/plugin/components/telemetry/dist/cli.js +2266 -405
- package/packages/omo-codex/plugin/components/telemetry/dist/posthog.js +2270 -409
- package/packages/omo-codex/plugin/components/telemetry/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/telemetry/package.json +5 -5
- package/packages/omo-codex/plugin/components/ultrawork/hooks/hooks.json +1 -1
- package/packages/omo-codex/plugin/components/ultrawork/package.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/dist/cli.js +1 -3
- package/packages/omo-codex/plugin/components/ulw-loop/dist/paths.js +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/hooks/hooks.json +4 -4
- package/packages/omo-codex/plugin/components/ulw-loop/package.json +5 -5
- package/packages/omo-codex/plugin/components/ulw-loop/src/paths.ts +1 -1
- package/packages/omo-codex/plugin/components/ulw-loop/test/cli-create-goals.test.ts +25 -0
- package/packages/omo-codex/plugin/components/ulw-loop/test/paths.test.ts +9 -0
- package/packages/omo-codex/plugin/components/ulw-loop/vitest.config.ts +1 -0
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-git-bash-mcp-reminder.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-lsp-diagnostics-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-compact-resetting-project-rule-cache.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-codegraph-init-guidance.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-comments.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-lsp-diagnostics.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-checking-thread-title-hygiene.json +1 -1
- package/packages/omo-codex/plugin/hooks/post-tool-use-matching-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-enforcing-unlimited-goal-budget.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-guarding-ulw-loop-spawns.json +1 -1
- package/packages/omo-codex/plugin/hooks/pre-tool-use-recommending-git-bash-mcp.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-auto-update.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-bootstrap-provisioning.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-checking-codegraph-bootstrap.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/hooks/session-start-recording-session-telemetry.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/stop-checking-ulw-loop-resume.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-checking-start-work-continuation.json +1 -1
- package/packages/omo-codex/plugin/hooks/subagent-stop-verifying-lazycodex-executor-evidence.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ultrawork-trigger.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-checking-ulw-loop-steering.json +1 -1
- package/packages/omo-codex/plugin/hooks/user-prompt-submit-loading-project-rules.json +1 -1
- package/packages/omo-codex/plugin/package-lock.json +661 -375
- package/packages/omo-codex/plugin/package.json +1 -1
- package/packages/omo-codex/plugin/shared/package.json +2 -3
- package/packages/omo-codex/plugin/skills/frontend/SKILL.md +1 -0
- package/packages/omo-codex/plugin/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/omo-codex/plugin/skills/ulw-research/SKILL.md +1 -1
- package/packages/omo-codex/plugin/skills/visual-qa/SKILL.md +3 -2
- package/packages/omo-codex/scripts/install-dist/install-local.mjs +2410 -504
- package/packages/shared-skills/skills/frontend/SKILL.md +1 -0
- package/packages/shared-skills/skills/frontend/references/design/print-paged-media.md +76 -0
- package/packages/shared-skills/skills/ulw-research/SKILL.md +1 -1
- package/packages/shared-skills/skills/visual-qa/SKILL.md +3 -2
- package/script/qa/web-terminal-visual-qa.mjs +2 -0
- package/script/qa/xterm-live-terminal.mjs +18 -2
package/dist/create-hooks.d.ts
CHANGED
|
@@ -75,6 +75,7 @@ export declare function createHooks(args: {
|
|
|
75
75
|
planFormatValidator: ReturnType<typeof import("./hooks").createPlanFormatValidatorHook> | null;
|
|
76
76
|
claudeCodeHooks: ReturnType<typeof import("./hooks").createClaudeCodeHooksHook> | null;
|
|
77
77
|
keywordDetector: ReturnType<typeof import("./hooks").createKeywordDetectorHook> | null;
|
|
78
|
+
btwSideContextInjector: ReturnType<typeof import("./features/btw-side").createBtwSideContextInjectorHook>;
|
|
78
79
|
contextInjectorMessagesTransform: ReturnType<typeof import("./features/context-injector").createContextInjectorMessagesTransformHook>;
|
|
79
80
|
teamModeStatusInjector: ReturnType<typeof import("./hooks").createTeamModeStatusInjector> | null;
|
|
80
81
|
teamMailboxInjector: ReturnType<typeof import("./hooks").createTeamMailboxInjector> | null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BtwSessionMessage } from "./tui-controller-types";
|
|
2
|
+
export declare function isBtwCommandDraft(input: string): boolean;
|
|
3
|
+
export declare function parseBtwQuestion(input: string): {
|
|
4
|
+
consumeDraft: boolean;
|
|
5
|
+
question: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function findBtwBoundaryMessageID(messages: BtwSessionMessage[]): string | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
import type { PluginContext } from "../../plugin/types";
|
|
3
|
+
export declare const BTW_BOUNDARY_SENTINEL = "<omo-btw-boundary>";
|
|
4
|
+
export { BTW_PARENT_CONTEXT_MAX_BYTES, BTW_PARENT_CONTEXT_MAX_MESSAGES, } from "./parent-context-budget";
|
|
5
|
+
type MessageWithParts = {
|
|
6
|
+
info: Message;
|
|
7
|
+
parts: Part[];
|
|
8
|
+
};
|
|
9
|
+
export declare function createBtwSideContextInjectorHook(args: {
|
|
10
|
+
client: PluginContext["client"];
|
|
11
|
+
}): {
|
|
12
|
+
"experimental.chat.messages.transform": (_input: Record<string, never>, output: {
|
|
13
|
+
messages: MessageWithParts[];
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { BTW_BOUNDARY_SENTINEL, createBtwSideContextInjectorHook, } from "./context-injector";
|
|
2
|
+
export { BTW_SIDE_METADATA_KEY, BTW_SIDE_METADATA_VERSION, createBtwSideMetadata, getBtwSideMetadata, parseBtwSideMetadata, } from "./metadata";
|
|
3
|
+
export type { BtwSideMetadata } from "./metadata";
|
|
4
|
+
export { createBtwSideController } from "./tui-controller";
|
|
5
|
+
export { isBtwCommandDraft } from "./btw-command-draft";
|
|
6
|
+
export type { BtwCreateSessionInput, BtwPromptRef, BtwSession, BtwSessionMessage, BtwSideControllerDependencies, BtwSideState, } from "./tui-controller-types";
|
|
7
|
+
export { forgetBtwSideSession, isTrackedBtwSideSession, markBtwSideSession, resetBtwSideSessionRegistryForTesting, trackBtwSideSession, } from "./server-session-registry";
|
|
8
|
+
export { registerBtwSideTui } from "./tui-wiring";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const BTW_SIDE_METADATA_KEY = "omo_btw_side";
|
|
2
|
+
export declare const BTW_SIDE_METADATA_VERSION = 1;
|
|
3
|
+
export type BtwSideMetadata = {
|
|
4
|
+
version: typeof BTW_SIDE_METADATA_VERSION;
|
|
5
|
+
parent_session_id: string;
|
|
6
|
+
boundary_message_id: string;
|
|
7
|
+
};
|
|
8
|
+
export declare function createBtwSideMetadata(args: {
|
|
9
|
+
parentSessionID: string;
|
|
10
|
+
boundaryMessageID: string;
|
|
11
|
+
}): BtwSideMetadata;
|
|
12
|
+
export declare function parseBtwSideMetadata(value: unknown): BtwSideMetadata | undefined;
|
|
13
|
+
export declare function getBtwSideMetadata(session: {
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
} | undefined): BtwSideMetadata | undefined;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Message, Part } from "@opencode-ai/sdk";
|
|
2
|
+
export declare const BTW_PARENT_CONTEXT_MAX_BYTES: number;
|
|
3
|
+
export declare const BTW_PARENT_CONTEXT_MAX_MESSAGES = 64;
|
|
4
|
+
type MessageWithParts = {
|
|
5
|
+
info: Message;
|
|
6
|
+
parts: Part[];
|
|
7
|
+
};
|
|
8
|
+
export declare function boundBtwParentContext(messages: MessageWithParts[]): MessageWithParts[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function trackBtwSideSession(session: {
|
|
2
|
+
id: string;
|
|
3
|
+
metadata?: Record<string, unknown>;
|
|
4
|
+
}): boolean;
|
|
5
|
+
export declare function markBtwSideSession(sessionID: string): void;
|
|
6
|
+
export declare function forgetBtwSideSession(sessionID: string): boolean;
|
|
7
|
+
export declare function isTrackedBtwSideSession(sessionID: string): boolean;
|
|
8
|
+
export declare function resetBtwSideSessionRegistryForTesting(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { BtwSideMetadata } from "./metadata";
|
|
2
|
+
type CachedAdoption = {
|
|
3
|
+
hydrated: false;
|
|
4
|
+
} | {
|
|
5
|
+
hydrated: true;
|
|
6
|
+
metadata?: BtwSideMetadata;
|
|
7
|
+
};
|
|
8
|
+
export declare function createBtwAdoptionCache(): {
|
|
9
|
+
read: (sessionID: string) => CachedAdoption;
|
|
10
|
+
write: (sessionID: string, metadata: BtwSideMetadata | undefined) => void;
|
|
11
|
+
removeForDeletion: (sessionID: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
export type BtwPromptRef = {
|
|
2
|
+
readonly hasAttachments: boolean;
|
|
3
|
+
readonly input: string;
|
|
4
|
+
set: (input: string) => void;
|
|
5
|
+
submit: () => void;
|
|
6
|
+
};
|
|
7
|
+
export type BtwSession = {
|
|
8
|
+
id: string;
|
|
9
|
+
title: string;
|
|
10
|
+
agent?: string;
|
|
11
|
+
model?: {
|
|
12
|
+
providerID: string;
|
|
13
|
+
id: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export type BtwSessionMessage = {
|
|
17
|
+
info: {
|
|
18
|
+
id: string;
|
|
19
|
+
role: "user" | "assistant";
|
|
20
|
+
time?: {
|
|
21
|
+
completed?: number;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export type BtwCreateSessionInput = {
|
|
26
|
+
title: string;
|
|
27
|
+
agent?: string;
|
|
28
|
+
model?: {
|
|
29
|
+
providerID: string;
|
|
30
|
+
id: string;
|
|
31
|
+
};
|
|
32
|
+
metadata: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
export type BtwSideControllerDependencies = {
|
|
35
|
+
getCurrentSessionID: () => string | undefined;
|
|
36
|
+
getSession: (sessionID: string) => BtwSession | undefined;
|
|
37
|
+
getMessages: (sessionID: string) => BtwSessionMessage[];
|
|
38
|
+
createSession: (input: BtwCreateSessionInput) => Promise<{
|
|
39
|
+
id: string;
|
|
40
|
+
title: string;
|
|
41
|
+
}>;
|
|
42
|
+
navigateSession: (sessionID: string) => void;
|
|
43
|
+
abortSession: (sessionID: string) => Promise<void>;
|
|
44
|
+
deleteSession: (sessionID: string) => Promise<void>;
|
|
45
|
+
showToast: (message: string) => void;
|
|
46
|
+
requestRender: () => void;
|
|
47
|
+
};
|
|
48
|
+
export type BtwSideState = {
|
|
49
|
+
phase: "closed";
|
|
50
|
+
} | {
|
|
51
|
+
phase: "creating";
|
|
52
|
+
parentSessionID: string;
|
|
53
|
+
} | {
|
|
54
|
+
phase: "open";
|
|
55
|
+
parentSessionID: string;
|
|
56
|
+
sideSessionID: string;
|
|
57
|
+
owned: boolean;
|
|
58
|
+
} | {
|
|
59
|
+
phase: "closing";
|
|
60
|
+
parentSessionID: string;
|
|
61
|
+
sideSessionID: string;
|
|
62
|
+
owned: boolean;
|
|
63
|
+
};
|
|
64
|
+
export type BtwSideRecord = {
|
|
65
|
+
parentSessionID: string;
|
|
66
|
+
sideSessionID: string;
|
|
67
|
+
owned: boolean;
|
|
68
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BtwPromptRef, BtwSideControllerDependencies, BtwSideRecord, BtwSideState } from "./tui-controller-types";
|
|
2
|
+
export declare function createBtwSideController(dependencies: BtwSideControllerDependencies): {
|
|
3
|
+
state: () => BtwSideState;
|
|
4
|
+
sides: () => BtwSideRecord[];
|
|
5
|
+
side: (sessionID: string) => BtwSideRecord | undefined;
|
|
6
|
+
sideNumber: (sessionID: string) => number | undefined;
|
|
7
|
+
rootParent: (sessionID: string) => string;
|
|
8
|
+
startFromPrompt: (promptRef: BtwPromptRef, parentSessionID?: string | undefined) => Promise<boolean>;
|
|
9
|
+
attachPromptRef: (sessionID: string, promptRef: BtwPromptRef | undefined) => void;
|
|
10
|
+
toggle: () => void;
|
|
11
|
+
close: () => Promise<void>;
|
|
12
|
+
returnToParent: () => void;
|
|
13
|
+
handleNavigation: (sessionID: string) => Promise<void>;
|
|
14
|
+
handleSessionDeleted: (sessionID: string) => void;
|
|
15
|
+
canCloseCurrentSide: () => boolean;
|
|
16
|
+
adopt: (parentSessionID: string, sideSessionID: string, sideNumber?: number) => void;
|
|
17
|
+
waitUntilClosed: () => Promise<void>;
|
|
18
|
+
dispose: () => Promise<void>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KeyEvent } from "@opentui/core";
|
|
2
|
+
import type { KeyInputContext } from "@opentui/keymap";
|
|
3
|
+
export declare function createBtwEscapeReturn(args: {
|
|
4
|
+
isCurrentSideIdle: () => boolean;
|
|
5
|
+
isDialogOpen: () => boolean;
|
|
6
|
+
clearPending: () => void;
|
|
7
|
+
returnToParent: () => void;
|
|
8
|
+
now?: () => number;
|
|
9
|
+
}): {
|
|
10
|
+
handle: (context: KeyInputContext<KeyEvent>) => void;
|
|
11
|
+
reset: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { TuiPluginApi, TuiPromptRef } from "@opencode-ai/plugin/tui";
|
|
2
|
+
import type { createBtwSideController } from "./tui-controller";
|
|
3
|
+
type BtwSideController = ReturnType<typeof createBtwSideController>;
|
|
4
|
+
export type BtwSideKeymapRegistration = {
|
|
5
|
+
unregister: Array<() => void>;
|
|
6
|
+
resetEscapeSequence: () => void;
|
|
7
|
+
};
|
|
8
|
+
export declare function registerBtwSideKeymap(args: {
|
|
9
|
+
api: TuiPluginApi;
|
|
10
|
+
controller: BtwSideController;
|
|
11
|
+
activePromptRef: () => TuiPromptRef | undefined;
|
|
12
|
+
openBtw: () => Promise<void>;
|
|
13
|
+
openPicker: () => Promise<void>;
|
|
14
|
+
isCurrentSideIdle: () => boolean;
|
|
15
|
+
returnToParent: () => void;
|
|
16
|
+
}): BtwSideKeymapRegistration;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { BtwSessionCatalog } from "./tui-session-catalog";
|
|
2
|
+
export type BtwPickerOption = {
|
|
3
|
+
title: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description: string;
|
|
6
|
+
category: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export type BtwPickerSelection = {
|
|
10
|
+
type: "session";
|
|
11
|
+
sessionID: string;
|
|
12
|
+
} | {
|
|
13
|
+
type: "new";
|
|
14
|
+
parentSessionID: string;
|
|
15
|
+
};
|
|
16
|
+
export declare function parseBtwPickerValue(value: string): BtwPickerSelection | undefined;
|
|
17
|
+
export declare function buildBtwPickerOptions(catalog: BtwSessionCatalog, currentSessionID: string): {
|
|
18
|
+
options: BtwPickerOption[];
|
|
19
|
+
current: string;
|
|
20
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { TuiPluginApi, TuiPromptRef } from "@opencode-ai/plugin/tui";
|
|
2
|
+
import type { createBtwSideController } from "./tui-controller";
|
|
3
|
+
type BtwSideController = ReturnType<typeof createBtwSideController>;
|
|
4
|
+
export declare function openBtwPicker(args: {
|
|
5
|
+
api: TuiPluginApi;
|
|
6
|
+
controller: BtwSideController;
|
|
7
|
+
activePromptRef: () => TuiPromptRef | undefined;
|
|
8
|
+
}): Promise<boolean>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BtwPromptRef } from "./tui-controller-types";
|
|
2
|
+
export declare function createBtwPromptQueue(): {
|
|
3
|
+
attach(sessionID: string, promptRef: BtwPromptRef | undefined): void;
|
|
4
|
+
queue(sessionID: string, question: string): void;
|
|
5
|
+
input(sessionID: string): string;
|
|
6
|
+
hasAttachments(sessionID: string): boolean;
|
|
7
|
+
clear(sessionID: string): void;
|
|
8
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { TuiPluginApi, TuiPromptRef } from "@opencode-ai/plugin/tui";
|
|
2
|
+
import type { BtwPromptRef, BtwSideControllerDependencies } from "./tui-controller-types";
|
|
3
|
+
export declare function unwrapTuiData<T>(response: {
|
|
4
|
+
data?: T;
|
|
5
|
+
error?: unknown;
|
|
6
|
+
}, message: string): T;
|
|
7
|
+
export declare function currentTuiSessionID(api: TuiPluginApi): string | undefined;
|
|
8
|
+
export declare function isCurrentTuiSession(api: TuiPluginApi, sessionID: string | undefined): boolean;
|
|
9
|
+
export declare function adaptTuiPromptRef(promptRef: TuiPromptRef): BtwPromptRef;
|
|
10
|
+
export declare function parentTuiStatusLabel(api: TuiPluginApi, parentSessionID: string): string;
|
|
11
|
+
export declare function createBtwControllerDependencies(api: TuiPluginApi): BtwSideControllerDependencies;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export type BtwCatalogSession = {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
metadata?: Record<string, unknown>;
|
|
5
|
+
time: {
|
|
6
|
+
created: number;
|
|
7
|
+
updated: number;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export type BtwSessionCatalog = {
|
|
11
|
+
main: BtwCatalogSession;
|
|
12
|
+
sides: BtwCatalogSession[];
|
|
13
|
+
};
|
|
14
|
+
type BtwSessionListInput = {
|
|
15
|
+
directory: string;
|
|
16
|
+
roots: false;
|
|
17
|
+
limit: number;
|
|
18
|
+
};
|
|
19
|
+
type BtwSessionListResponse = {
|
|
20
|
+
data?: BtwCatalogSession[];
|
|
21
|
+
error?: unknown;
|
|
22
|
+
};
|
|
23
|
+
type LoadBtwSessionCatalogInput = {
|
|
24
|
+
currentSessionID: string;
|
|
25
|
+
directory: string;
|
|
26
|
+
listSessions: (input: BtwSessionListInput) => Promise<BtwSessionListResponse>;
|
|
27
|
+
initialLimit?: number;
|
|
28
|
+
maximumLimit?: number;
|
|
29
|
+
};
|
|
30
|
+
export declare function classifyBtwSessionCatalog(sessions: BtwCatalogSession[], currentSessionID: string): BtwSessionCatalog | undefined;
|
|
31
|
+
export declare function loadBtwSessionCatalog(input: LoadBtwSessionCatalogInput): Promise<{
|
|
32
|
+
catalog: BtwSessionCatalog | undefined;
|
|
33
|
+
truncated: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function abortBtwSide(args: {
|
|
2
|
+
sessionID: string;
|
|
3
|
+
abortSession: (sessionID: string) => Promise<void>;
|
|
4
|
+
showToast: (message: string) => void;
|
|
5
|
+
}): Promise<void>;
|
|
6
|
+
export declare function deleteBtwSide(args: {
|
|
7
|
+
sessionID: string;
|
|
8
|
+
deleteSession: (sessionID: string) => Promise<void>;
|
|
9
|
+
showToast: (message: string) => void;
|
|
10
|
+
failureMessage: string;
|
|
11
|
+
}): Promise<boolean>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BtwCreateSessionInput, BtwPromptRef, BtwSideControllerDependencies } from "./tui-controller-types";
|
|
2
|
+
export type PreparedBtwSideStart = {
|
|
3
|
+
parentSessionID: string;
|
|
4
|
+
originalDraft: string;
|
|
5
|
+
consumeDraft: boolean;
|
|
6
|
+
question: string;
|
|
7
|
+
createInput: BtwCreateSessionInput;
|
|
8
|
+
};
|
|
9
|
+
export declare function prepareBtwSideStart(dependencies: BtwSideControllerDependencies, promptRef: BtwPromptRef, parentSessionID?: string | undefined): PreparedBtwSideStart | undefined;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TuiPluginApi } from "@opencode-ai/plugin/tui";
|
|
2
|
+
type SolidRuntime<Node> = {
|
|
3
|
+
readonly createElement: (tag: string) => Node;
|
|
4
|
+
readonly insert: (parent: Node, child: unknown, marker?: unknown, initial?: unknown) => unknown;
|
|
5
|
+
readonly setProp: (node: Node, name: string, value: unknown, previous?: unknown) => unknown;
|
|
6
|
+
};
|
|
7
|
+
export declare function registerBtwSideTui<Node>(api: TuiPluginApi, solid: SolidRuntime<Node>): Promise<void>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Injects OpenGateway into opencode's live config so its models appear without
|
|
3
|
+
* the user hand-writing a provider block.
|
|
4
|
+
*
|
|
5
|
+
* opencode activates every `config.provider` entry regardless of credentials, so
|
|
6
|
+
* the injection is gated on an actual credential: the API key env var, or an
|
|
7
|
+
* `opengateway` entry in opencode's auth.json. Without one, the config is left
|
|
8
|
+
* exactly as it came in.
|
|
9
|
+
*/
|
|
10
|
+
export declare const OPENGATEWAY_PROVIDER_ID = "opengateway";
|
|
11
|
+
export declare const OPENGATEWAY_BASE_URL = "https://apis.opengateway.ai/v1";
|
|
12
|
+
export declare const OPENGATEWAY_ENV_VAR = "OPENGATEWAY_API_KEY";
|
|
13
|
+
export declare function applyOpenGatewayProviderConfig(config: Record<string, unknown>): void;
|
|
@@ -6,12 +6,14 @@ export declare function createChatMessageHandler(deps: HookDeps): (input: {
|
|
|
6
6
|
providerID: string;
|
|
7
7
|
modelID: string;
|
|
8
8
|
};
|
|
9
|
+
variant?: string;
|
|
9
10
|
}, output: {
|
|
10
11
|
message: {
|
|
11
12
|
model?: {
|
|
12
13
|
providerID: string;
|
|
13
14
|
modelID: string;
|
|
14
15
|
};
|
|
16
|
+
variant?: string;
|
|
15
17
|
};
|
|
16
18
|
parts?: Array<{
|
|
17
19
|
type: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { OhMyOpenCodeConfig } from "../../config";
|
|
2
|
+
export type RuntimeModelSettings = {
|
|
3
|
+
reasoning?: string;
|
|
4
|
+
reasoningEffort?: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function resolveRuntimeModelSettings(sessionID: string, agent: string | undefined, pluginConfig: OhMyOpenCodeConfig | undefined): RuntimeModelSettings;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { HookDeps } from "./types";
|
|
2
2
|
import type { AutoRetryHelpers } from "./auto-retry";
|
|
3
|
-
export declare function createSessionStatusHandler(deps: HookDeps, helpers: AutoRetryHelpers, sessionStatusRetryKeys: Map<string, string
|
|
3
|
+
export declare function createSessionStatusHandler(deps: HookDeps, helpers: AutoRetryHelpers, sessionStatusRetryKeys: Map<string, Set<string>>): (props: Record<string, unknown> | undefined) => Promise<void>;
|
|
@@ -96,12 +96,14 @@ export interface RuntimeFallbackHook {
|
|
|
96
96
|
providerID: string;
|
|
97
97
|
modelID: string;
|
|
98
98
|
};
|
|
99
|
+
variant?: string;
|
|
99
100
|
}, output: {
|
|
100
101
|
message: {
|
|
101
102
|
model?: {
|
|
102
103
|
providerID: string;
|
|
103
104
|
modelID: string;
|
|
104
105
|
};
|
|
106
|
+
variant?: string;
|
|
105
107
|
};
|
|
106
108
|
parts?: Array<{
|
|
107
109
|
type: string;
|
|
@@ -120,7 +122,7 @@ export interface HookDeps {
|
|
|
120
122
|
sessionRetryInFlight: Set<string>;
|
|
121
123
|
sessionAwaitingFallbackResult: Set<string>;
|
|
122
124
|
sessionFallbackTimeouts: Map<string, RuntimeFallbackTimeout>;
|
|
123
|
-
sessionStatusRetryKeys: Map<string, string
|
|
125
|
+
sessionStatusRetryKeys: Map<string, Set<string>>;
|
|
124
126
|
/**
|
|
125
127
|
* Sessions whose in-flight request was aborted by us (to swap in a fallback
|
|
126
128
|
* model), as opposed to a user-initiated stop. Consumed by
|