oh-my-opencode-lite 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +365 -0
- package/dist/agents/deep.d.ts +2 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -0
- package/dist/agents/index.d.ts +8 -0
- package/dist/agents/librarian.d.ts +2 -0
- package/dist/agents/oracle.d.ts +2 -0
- package/dist/agents/orchestrator.d.ts +15 -0
- package/dist/agents/prompt-utils.d.ts +10 -0
- package/dist/agents/quick.d.ts +2 -0
- package/dist/background/background-manager.d.ts +196 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +63 -0
- package/dist/cli/config-io.d.ts +22 -0
- package/dist/cli/config-manager.d.ts +4 -0
- package/dist/cli/custom-skills.d.ts +48 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +1178 -0
- package/dist/cli/install.d.ts +3 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/paths.d.ts +21 -0
- package/dist/cli/providers.d.ts +120 -0
- package/dist/cli/skill-manifest.d.ts +32 -0
- package/dist/cli/skills.d.ts +26 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +38 -0
- package/dist/config/constants.d.ts +19 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/loader.d.ts +33 -0
- package/dist/config/schema.d.ts +313 -0
- package/dist/config/utils.d.ts +10 -0
- package/dist/delegation/delegation-manager.d.ts +25 -0
- package/dist/delegation/index.d.ts +4 -0
- package/dist/delegation/paths.d.ts +15 -0
- package/dist/delegation/project-id.d.ts +1 -0
- package/dist/delegation/types.d.ts +39 -0
- package/dist/hooks/auto-update-checker/cache.d.ts +6 -0
- package/dist/hooks/auto-update-checker/checker.d.ts +28 -0
- package/dist/hooks/auto-update-checker/constants.d.ts +11 -0
- package/dist/hooks/auto-update-checker/index.d.ts +17 -0
- package/dist/hooks/auto-update-checker/types.d.ts +23 -0
- package/dist/hooks/chat-headers.d.ts +16 -0
- package/dist/hooks/clarification-gate/index.d.ts +30 -0
- package/dist/hooks/delegate-task-retry/guidance.d.ts +2 -0
- package/dist/hooks/delegate-task-retry/hook.d.ts +8 -0
- package/dist/hooks/delegate-task-retry/index.d.ts +4 -0
- package/dist/hooks/delegate-task-retry/patterns.d.ts +11 -0
- package/dist/hooks/foreground-fallback/index.d.ts +72 -0
- package/dist/hooks/index.d.ts +11 -0
- package/dist/hooks/json-error-recovery/hook.d.ts +18 -0
- package/dist/hooks/json-error-recovery/index.d.ts +1 -0
- package/dist/hooks/phase-reminder/index.d.ts +26 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/hooks/skill-sync.d.ts +10 -0
- package/dist/hooks/thoth-mem/index.d.ts +46 -0
- package/dist/hooks/thoth-mem/protocol.d.ts +6 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +36210 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/thoth.d.ts +3 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/thoth/client.d.ts +14 -0
- package/dist/thoth/index.d.ts +2 -0
- package/dist/tools/ast-grep/cli.d.ts +15 -0
- package/dist/tools/ast-grep/constants.d.ts +25 -0
- package/dist/tools/ast-grep/downloader.d.ts +5 -0
- package/dist/tools/ast-grep/index.d.ts +10 -0
- package/dist/tools/ast-grep/tools.d.ts +3 -0
- package/dist/tools/ast-grep/types.d.ts +30 -0
- package/dist/tools/ast-grep/utils.d.ts +4 -0
- package/dist/tools/background.d.ts +13 -0
- package/dist/tools/index.d.ts +3 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config-store.d.ts +29 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +24 -0
- package/dist/tools/lsp/index.d.ts +4 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +35 -0
- package/dist/tools/lsp/utils.d.ts +34 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.d.ts +7 -0
- package/dist/utils/internal-initiator.d.ts +6 -0
- package/dist/utils/logger.d.ts +1 -0
- package/dist/utils/polling.d.ts +21 -0
- package/dist/utils/tmux.d.ts +32 -0
- package/dist/utils/zip-extractor.d.ts +1 -0
- package/oh-my-opencode-lite.schema.json +556 -0
- package/package.json +74 -0
- package/src/skills/_shared/openspec-convention.md +92 -0
- package/src/skills/_shared/persistence-contract.md +78 -0
- package/src/skills/_shared/thoth-mem-convention.md +80 -0
- package/src/skills/brainstorming/SKILL.md +120 -0
- package/src/skills/cartography/README.md +57 -0
- package/src/skills/cartography/SKILL.md +160 -0
- package/src/skills/cartography/scripts/cartographer.py +460 -0
- package/src/skills/cartography/scripts/test_cartographer.py +87 -0
- package/src/skills/executing-plans/SKILL.md +211 -0
- package/src/skills/plan-reviewer/SKILL.md +100 -0
- package/src/skills/sdd-apply/SKILL.md +101 -0
- package/src/skills/sdd-archive/SKILL.md +94 -0
- package/src/skills/sdd-design/SKILL.md +104 -0
- package/src/skills/sdd-propose/SKILL.md +99 -0
- package/src/skills/sdd-spec/SKILL.md +105 -0
- package/src/skills/sdd-tasks/SKILL.md +116 -0
- package/src/skills/sdd-verify/SKILL.md +102 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DelegationConfig } from '../config';
|
|
2
|
+
export interface DelegationPaths {
|
|
3
|
+
storageDir: string;
|
|
4
|
+
projectDir: string;
|
|
5
|
+
sessionDir: string;
|
|
6
|
+
taskFile: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function resolveStorageDir(config?: DelegationConfig): string;
|
|
9
|
+
export declare function resolvePaths(input: {
|
|
10
|
+
config?: DelegationConfig;
|
|
11
|
+
projectId: string;
|
|
12
|
+
rootSessionId: string;
|
|
13
|
+
taskId: string;
|
|
14
|
+
}): DelegationPaths;
|
|
15
|
+
export declare function ensureDelegationDirectories(paths: Pick<DelegationPaths, 'projectDir' | 'sessionDir'>): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getProjectId(directory: string, timeoutMs?: number): Promise<string | null>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const DELEGATION_STATUSES: readonly ["running", "complete", "error", "timeout", "cancelled"];
|
|
2
|
+
export type DelegationStatus = (typeof DELEGATION_STATUSES)[number];
|
|
3
|
+
export interface DelegationRecord {
|
|
4
|
+
id: string;
|
|
5
|
+
agent: string;
|
|
6
|
+
status: DelegationStatus;
|
|
7
|
+
title: string;
|
|
8
|
+
summary: string;
|
|
9
|
+
startedAt: string;
|
|
10
|
+
completedAt: string | null;
|
|
11
|
+
content: string;
|
|
12
|
+
}
|
|
13
|
+
export type DelegationHeader = {
|
|
14
|
+
id: string;
|
|
15
|
+
title: string;
|
|
16
|
+
summary: string;
|
|
17
|
+
agent: string;
|
|
18
|
+
status: DelegationStatus;
|
|
19
|
+
projectId: string;
|
|
20
|
+
rootSessionId: string;
|
|
21
|
+
startedAt: string;
|
|
22
|
+
completedAt: string | null;
|
|
23
|
+
persistedAt: string;
|
|
24
|
+
};
|
|
25
|
+
export interface PersistedDelegationRecord {
|
|
26
|
+
path: string;
|
|
27
|
+
header: DelegationHeader;
|
|
28
|
+
record: DelegationRecord;
|
|
29
|
+
}
|
|
30
|
+
export interface DelegationListEntry {
|
|
31
|
+
path: string;
|
|
32
|
+
id: string;
|
|
33
|
+
agent: string;
|
|
34
|
+
status: DelegationStatus;
|
|
35
|
+
title: string;
|
|
36
|
+
summary: string;
|
|
37
|
+
startedAt: string;
|
|
38
|
+
completedAt: string | null;
|
|
39
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Invalidates the current package by removing its directory and dependency entries.
|
|
3
|
+
* This forces a clean state before running a fresh install.
|
|
4
|
+
* @param packageName The name of the package to invalidate.
|
|
5
|
+
*/
|
|
6
|
+
export declare function invalidatePackage(packageName?: string): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { PluginEntryInfo } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Extracts the update channel (latest, alpha, beta, etc.) from a version string.
|
|
4
|
+
* @param version The version or tag to analyze.
|
|
5
|
+
* @returns The channel name.
|
|
6
|
+
*/
|
|
7
|
+
export declare function extractChannel(version: string | null): string;
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the version of the plugin when running in local development mode.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getLocalDevVersion(directory: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Searches across all config locations to find the current installation entry for this plugin.
|
|
14
|
+
*/
|
|
15
|
+
export declare function findPluginEntry(directory: string): PluginEntryInfo | null;
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the installed version from node_modules, with memoization.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getCachedVersion(): string | null;
|
|
20
|
+
/**
|
|
21
|
+
* Safely updates a pinned version in the configuration file.
|
|
22
|
+
* It attempts to replace the exact plugin string to preserve comments and formatting.
|
|
23
|
+
*/
|
|
24
|
+
export declare function updatePinnedVersion(configPath: string, oldEntry: string, newVersion: string): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Fetches the latest version for a specific channel from the NPM registry.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getLatestVersion(channel?: string): Promise<string | null>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const PACKAGE_NAME = "oh-my-opencode-lite";
|
|
2
|
+
export declare const NPM_REGISTRY_URL = "https://registry.npmjs.org/-/package/oh-my-opencode-lite/dist-tags";
|
|
3
|
+
export declare const NPM_FETCH_TIMEOUT = 5000;
|
|
4
|
+
/** The directory used by OpenCode to cache node_modules for plugins. */
|
|
5
|
+
export declare const CACHE_DIR: string;
|
|
6
|
+
/** Path to this plugin's package.json within the OpenCode cache. */
|
|
7
|
+
export declare const INSTALLED_PACKAGE_JSON: string;
|
|
8
|
+
/** Primary OpenCode configuration file path (standard JSON). */
|
|
9
|
+
export declare const USER_OPENCODE_CONFIG: string;
|
|
10
|
+
/** Alternative OpenCode configuration file path (JSON with Comments). */
|
|
11
|
+
export declare const USER_OPENCODE_CONFIG_JSONC: string;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
import type { AutoUpdateCheckerOptions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates an OpenCode hook that checks for plugin updates when a new session is created.
|
|
5
|
+
* @param ctx The plugin input context.
|
|
6
|
+
* @param options Configuration options for the update checker.
|
|
7
|
+
* @returns A hook object for the session.created event.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createAutoUpdateCheckerHook(ctx: PluginInput, options?: AutoUpdateCheckerOptions): {
|
|
10
|
+
event: ({ event }: {
|
|
11
|
+
event: {
|
|
12
|
+
type: string;
|
|
13
|
+
properties?: unknown;
|
|
14
|
+
};
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
export type { AutoUpdateCheckerOptions } from './types';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export interface NpmDistTags {
|
|
2
|
+
latest: string;
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OpencodeConfig {
|
|
6
|
+
plugin?: string[];
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}
|
|
9
|
+
export interface PackageJson {
|
|
10
|
+
version: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}
|
|
14
|
+
export interface AutoUpdateCheckerOptions {
|
|
15
|
+
showStartupToast?: boolean;
|
|
16
|
+
autoUpdate?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface PluginEntryInfo {
|
|
19
|
+
entry: string;
|
|
20
|
+
isPinned: boolean;
|
|
21
|
+
pinnedVersion: string | null;
|
|
22
|
+
configPath: string;
|
|
23
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PluginInput, ProviderContext } from '@opencode-ai/plugin';
|
|
2
|
+
import type { Model, UserMessage } from '@opencode-ai/sdk';
|
|
3
|
+
interface ChatHeadersInput {
|
|
4
|
+
sessionID: string;
|
|
5
|
+
model: Model;
|
|
6
|
+
provider: ProviderContext;
|
|
7
|
+
message: UserMessage;
|
|
8
|
+
}
|
|
9
|
+
interface ChatHeadersOutput {
|
|
10
|
+
headers: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export declare function __resetInternalMarkerCacheForTesting(): void;
|
|
13
|
+
export declare function createChatHeadersHook(ctx: PluginInput): {
|
|
14
|
+
'chat.headers': (input: ChatHeadersInput, output: ChatHeadersOutput) => Promise<void>;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type ClarificationGateConfig } from '../../config';
|
|
2
|
+
export declare const CLARIFICATION_GATE_TAG = "clarification-gate";
|
|
3
|
+
interface MessageInfo {
|
|
4
|
+
role: string;
|
|
5
|
+
agent?: string;
|
|
6
|
+
sessionID?: string;
|
|
7
|
+
}
|
|
8
|
+
interface MessagePart {
|
|
9
|
+
type: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}
|
|
13
|
+
interface MessageWithParts {
|
|
14
|
+
info: MessageInfo;
|
|
15
|
+
parts: MessagePart[];
|
|
16
|
+
}
|
|
17
|
+
export interface CreateClarificationGateHookOptions {
|
|
18
|
+
clarificationGate?: Partial<ClarificationGateConfig>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates the experimental.chat.messages.transform hook for clarification gate injection.
|
|
22
|
+
* This hook runs right before sending to API, so it doesn't affect UI display.
|
|
23
|
+
* Only injects for the orchestrator agent.
|
|
24
|
+
*/
|
|
25
|
+
export declare function createClarificationGateHook(options?: CreateClarificationGateHookOptions): {
|
|
26
|
+
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
27
|
+
messages: MessageWithParts[];
|
|
28
|
+
}) => Promise<void>;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface DelegateTaskErrorPattern {
|
|
2
|
+
pattern: string;
|
|
3
|
+
errorType: string;
|
|
4
|
+
fixHint: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const DELEGATE_TASK_ERROR_PATTERNS: DelegateTaskErrorPattern[];
|
|
7
|
+
export interface DetectedError {
|
|
8
|
+
errorType: string;
|
|
9
|
+
originalOutput: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function detectDelegateTaskError(output: string): DetectedError | null;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime model fallback for foreground (interactive) agent sessions.
|
|
3
|
+
*
|
|
4
|
+
* When OpenCode fires a session.error, message.updated, or session.status
|
|
5
|
+
* event containing a rate-limit signal, this manager:
|
|
6
|
+
* 1. Looks up the next untried model in the agent's configured chain
|
|
7
|
+
* 2. Aborts the rate-limited prompt via client.session.abort()
|
|
8
|
+
* 3. Re-queues the last user message via client.session.promptAsync()
|
|
9
|
+
* with the new model — promptAsync returns immediately so we never
|
|
10
|
+
* block the event handler waiting for a full LLM response.
|
|
11
|
+
*
|
|
12
|
+
* This mirrors the BackgroundTaskManager's fallback loop but operates
|
|
13
|
+
* reactively through the event system instead of wrapping prompt() in a
|
|
14
|
+
* try/catch, which is not possible for interactive (foreground) sessions.
|
|
15
|
+
*/
|
|
16
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
17
|
+
type OpencodeClient = PluginInput['client'];
|
|
18
|
+
export declare function isRateLimitError(error: unknown): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Manages runtime model fallback for foreground agent sessions.
|
|
21
|
+
*
|
|
22
|
+
* Constructed at plugin init with the ordered fallback chains for each agent
|
|
23
|
+
* (built from _modelArray entries merged with fallback.chains config).
|
|
24
|
+
*/
|
|
25
|
+
export declare class ForegroundFallbackManager {
|
|
26
|
+
private readonly client;
|
|
27
|
+
/**
|
|
28
|
+
* Ordered fallback chains per agent.
|
|
29
|
+
* e.g. { orchestrator: ['anthropic/claude-opus-4-5', 'openai/gpt-4o'] }
|
|
30
|
+
* The first model that hasn't been tried yet is selected on each fallback.
|
|
31
|
+
*/
|
|
32
|
+
private readonly chains;
|
|
33
|
+
private readonly enabled;
|
|
34
|
+
/** sessionID → last observed model string ("providerID/modelID") */
|
|
35
|
+
private readonly sessionModel;
|
|
36
|
+
/** sessionID → agent name (populated from message.updated info.agent field) */
|
|
37
|
+
private readonly sessionAgent;
|
|
38
|
+
/** sessionID → set of models already attempted this session */
|
|
39
|
+
private readonly sessionTried;
|
|
40
|
+
/** Sessions with an active fallback switch in flight */
|
|
41
|
+
private readonly inProgress;
|
|
42
|
+
/** sessionID → timestamp of last trigger (for deduplication) */
|
|
43
|
+
private readonly lastTrigger;
|
|
44
|
+
constructor(client: OpencodeClient,
|
|
45
|
+
/**
|
|
46
|
+
* Ordered fallback chains per agent.
|
|
47
|
+
* e.g. { orchestrator: ['anthropic/claude-opus-4-5', 'openai/gpt-4o'] }
|
|
48
|
+
* The first model that hasn't been tried yet is selected on each fallback.
|
|
49
|
+
*/
|
|
50
|
+
chains: Record<string, string[]>, enabled: boolean);
|
|
51
|
+
/**
|
|
52
|
+
* Process an OpenCode plugin event.
|
|
53
|
+
* Call this from the plugin's `event` hook for every event received.
|
|
54
|
+
*/
|
|
55
|
+
handleEvent(rawEvent: unknown): Promise<void>;
|
|
56
|
+
private tryFallback;
|
|
57
|
+
/**
|
|
58
|
+
* Determine the fallback chain to use for a session.
|
|
59
|
+
*
|
|
60
|
+
* Priority:
|
|
61
|
+
* 1. Agent name known AND has a configured chain → return it directly
|
|
62
|
+
* 2. Agent name known but NO chain configured → return [] (no fallback;
|
|
63
|
+
* do NOT bleed into other agents' chains which would re-prompt the
|
|
64
|
+
* session with a model belonging to a completely different agent)
|
|
65
|
+
* 3. Agent name unknown, current model known → search all chains for
|
|
66
|
+
* the model to infer which chain to use
|
|
67
|
+
* 4. Nothing matches → flatten all chains as a last resort (only
|
|
68
|
+
* reached when both agent name and current model are unavailable)
|
|
69
|
+
*/
|
|
70
|
+
private resolveChain;
|
|
71
|
+
}
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type { AutoUpdateCheckerOptions } from './auto-update-checker';
|
|
2
|
+
export { createAutoUpdateCheckerHook } from './auto-update-checker';
|
|
3
|
+
export { createChatHeadersHook } from './chat-headers';
|
|
4
|
+
export { createClarificationGateHook } from './clarification-gate';
|
|
5
|
+
export { createDelegateTaskRetryHook } from './delegate-task-retry';
|
|
6
|
+
export { ForegroundFallbackManager, isRateLimitError, } from './foreground-fallback';
|
|
7
|
+
export { createJsonErrorRecoveryHook } from './json-error-recovery';
|
|
8
|
+
export { createPhaseReminderHook } from './phase-reminder';
|
|
9
|
+
export { createPostReadNudgeHook } from './post-read-nudge';
|
|
10
|
+
export { syncSkillsOnStartup } from './skill-sync';
|
|
11
|
+
export { createThothMemHook } from './thoth-mem';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from '@opencode-ai/plugin';
|
|
2
|
+
export declare const JSON_ERROR_TOOL_EXCLUDE_LIST: readonly ["bash", "read", "glob", "webfetch", "grep_app_searchgithub", "websearch_web_search_exa"];
|
|
3
|
+
export declare const JSON_ERROR_PATTERNS: readonly [RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp, RegExp];
|
|
4
|
+
export declare const JSON_ERROR_REMINDER = "\n[JSON PARSE ERROR - IMMEDIATE ACTION REQUIRED]\n\nYou sent invalid JSON arguments. The system could not parse your tool call.\nSTOP and do this NOW:\n\n1. LOOK at the error message above to see what was expected vs what you sent.\n2. CORRECT your JSON syntax (missing braces, unescaped quotes, trailing commas, etc).\n3. RETRY the tool call with valid JSON.\n\nDO NOT repeat the exact same invalid call.\n";
|
|
5
|
+
interface ToolExecuteAfterInput {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID: string;
|
|
8
|
+
callID: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolExecuteAfterOutput {
|
|
11
|
+
title: string;
|
|
12
|
+
output: unknown;
|
|
13
|
+
metadata: unknown;
|
|
14
|
+
}
|
|
15
|
+
export declare function createJsonErrorRecoveryHook(_ctx: PluginInput): {
|
|
16
|
+
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createJsonErrorRecoveryHook, JSON_ERROR_PATTERNS, JSON_ERROR_REMINDER, JSON_ERROR_TOOL_EXCLUDE_LIST, } from './hook';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const PHASE_REMINDER = "<reminder>Recall Workflow Rules:\nUnderstand \u2192 find the best path (delegate based on rules and parallelize independent work) \u2192 execute \u2192 verify.\nIf delegating, launch the specialist in the same turn you mention it.</reminder>";
|
|
2
|
+
interface MessageInfo {
|
|
3
|
+
role: string;
|
|
4
|
+
agent?: string;
|
|
5
|
+
sessionID?: string;
|
|
6
|
+
}
|
|
7
|
+
interface MessagePart {
|
|
8
|
+
type: string;
|
|
9
|
+
text?: string;
|
|
10
|
+
[key: string]: unknown;
|
|
11
|
+
}
|
|
12
|
+
interface MessageWithParts {
|
|
13
|
+
info: MessageInfo;
|
|
14
|
+
parts: MessagePart[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates the experimental.chat.messages.transform hook for phase reminder injection.
|
|
18
|
+
* This hook runs right before sending to API, so it doesn't affect UI display.
|
|
19
|
+
* Only injects for the orchestrator agent.
|
|
20
|
+
*/
|
|
21
|
+
export declare function createPhaseReminderHook(): {
|
|
22
|
+
'experimental.chat.messages.transform': (_input: Record<string, never>, output: {
|
|
23
|
+
messages: MessageWithParts[];
|
|
24
|
+
}) => Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Post-Read nudge - appends a delegation reminder after file reads.
|
|
3
|
+
* Catches the "read files → implement myself" anti-pattern.
|
|
4
|
+
*/
|
|
5
|
+
interface ToolExecuteAfterInput {
|
|
6
|
+
tool: string;
|
|
7
|
+
sessionID?: string;
|
|
8
|
+
callID?: string;
|
|
9
|
+
}
|
|
10
|
+
interface ToolExecuteAfterOutput {
|
|
11
|
+
title: string;
|
|
12
|
+
output: string;
|
|
13
|
+
metadata: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function createPostReadNudgeHook(): {
|
|
16
|
+
'tool.execute.after': (input: ToolExecuteAfterInput, output: ToolExecuteAfterOutput) => Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { installCustomSkills } from '../cli/custom-skills';
|
|
2
|
+
import { log } from '../utils/logger';
|
|
3
|
+
interface SkillSyncDependencies {
|
|
4
|
+
install?: typeof installCustomSkills;
|
|
5
|
+
logger?: typeof log;
|
|
6
|
+
warn?: typeof console.warn;
|
|
7
|
+
error?: typeof console.error;
|
|
8
|
+
}
|
|
9
|
+
export declare function syncSkillsOnStartup(dependencies?: SkillSyncDependencies): void;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { Event, Model, Part } from '@opencode-ai/sdk';
|
|
2
|
+
import type { ThothConfig } from '../../config';
|
|
3
|
+
export interface CreateThothMemHookOptions {
|
|
4
|
+
project: string;
|
|
5
|
+
directory?: string;
|
|
6
|
+
thoth?: ThothConfig;
|
|
7
|
+
enabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export declare function createThothMemHook(options: CreateThothMemHookOptions): {
|
|
10
|
+
event: ({ event }: {
|
|
11
|
+
event: Event;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
'chat.message': (input: {
|
|
14
|
+
sessionID: string;
|
|
15
|
+
}, output: {
|
|
16
|
+
parts: Part[];
|
|
17
|
+
message: {
|
|
18
|
+
summary?: {
|
|
19
|
+
title?: string;
|
|
20
|
+
body?: string;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}) => Promise<void>;
|
|
24
|
+
'experimental.chat.system.transform': (input: {
|
|
25
|
+
sessionID?: string;
|
|
26
|
+
model: Model;
|
|
27
|
+
}, output: {
|
|
28
|
+
system: string[];
|
|
29
|
+
}) => Promise<void>;
|
|
30
|
+
'experimental.session.compacting': (input: {
|
|
31
|
+
sessionID: string;
|
|
32
|
+
}, output: {
|
|
33
|
+
context: string[];
|
|
34
|
+
prompt?: string;
|
|
35
|
+
}) => Promise<void>;
|
|
36
|
+
'tool.execute.after': (input: {
|
|
37
|
+
tool: string;
|
|
38
|
+
sessionID: string;
|
|
39
|
+
callID: string;
|
|
40
|
+
args: unknown;
|
|
41
|
+
}, output: {
|
|
42
|
+
title: string;
|
|
43
|
+
output: string;
|
|
44
|
+
metadata: unknown;
|
|
45
|
+
}) => Promise<void>;
|
|
46
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const SDD_TOPIC_KEY_FORMAT = "sdd/{change}/{artifact}";
|
|
2
|
+
export declare const FIRST_ACTION_INSTRUCTION = "FIRST ACTION REQUIRED: Call mem_session_summary with the content of the compacted summary. This preserves what was accomplished before compaction. Do this BEFORE any other work. Then call mem_context to recover additional context from previous sessions.";
|
|
3
|
+
export declare const SESSION_SUMMARY_TEMPLATE = "Use this exact structure for `mem_session_summary` content:\n\n## Goal\n[What we were working on this session]\n\n## Instructions\n[User preferences or constraints discovered during this session]\n\n## Discoveries\n- [Technical findings, gotchas, non-obvious learnings]\n\n## Accomplished\n- [Completed items with key details]\n\n## Next Steps\n- [What remains to be done]\n\n## Relevant Files\n- path/to/file.ts - [what it does or what changed]";
|
|
4
|
+
export declare function buildCompactionReminder(sessionID: string): string;
|
|
5
|
+
export declare function buildCompactorInstruction(project: string): string;
|
|
6
|
+
export declare function buildMemoryInstructions(sessionID: string, project: string): string;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Plugin } from '@opencode-ai/plugin';
|
|
2
|
+
declare const OhMyOpenCodeLite: Plugin;
|
|
3
|
+
export default OhMyOpenCodeLite;
|
|
4
|
+
export type { AgentName, AgentOverrideConfig, McpName, PluginConfig, TmuxConfig, TmuxLayout, } from './config';
|
|
5
|
+
export type { RemoteMcpConfig } from './mcp';
|