oh-my-opencode 4.2.1 → 4.2.3
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 +7 -0
- package/README.ko.md +7 -0
- package/README.md +13 -0
- package/README.ru.md +7 -0
- package/README.zh-cn.md +7 -0
- package/dist/cli/doctor/checks/tools-lsp.d.ts +6 -1
- package/dist/cli/index.js +2367 -1240
- package/dist/features/background-agent/parent-wake-notifier.d.ts +1 -1
- package/dist/hooks/comment-checker/apply-patch-edits.d.ts +2 -0
- package/dist/hooks/comment-checker/hook.d.ts +1 -0
- package/dist/hooks/comment-checker/initialization-gate.d.ts +1 -0
- package/dist/hooks/directory-agents-injector/finder.d.ts +4 -2
- package/dist/hooks/directory-agents-injector/injector.d.ts +2 -0
- package/dist/hooks/rules-injector/injector.d.ts +7 -3
- package/dist/hooks/rules-injector/matcher.d.ts +3 -24
- package/dist/hooks/rules-injector/parser.d.ts +2 -18
- package/dist/hooks/rules-injector/project-root-finder.d.ts +1 -13
- package/dist/hooks/rules-injector/rule-distance.d.ts +1 -10
- package/dist/hooks/rules-injector/rule-file-finder.d.ts +2 -6
- package/dist/hooks/rules-injector/rule-file-scanner.d.ts +2 -13
- package/dist/hooks/rules-injector/rule-scan-cache.d.ts +2 -13
- package/dist/hooks/rules-injector/transcript-hydration.d.ts +18 -0
- package/dist/hooks/rules-injector/types.d.ts +2 -38
- package/dist/hooks/runtime-fallback/types.d.ts +1 -0
- package/dist/hooks/team-session-events/team-member-error-handler.d.ts +14 -1
- package/dist/hooks/unstable-agent-babysitter/unstable-agent-babysitter-hook.d.ts +0 -21
- package/dist/index.js +4094 -3170
- package/dist/mcp/ast-grep.d.ts +9 -0
- package/dist/mcp/index.d.ts +4 -1
- package/dist/mcp/types.d.ts +1 -0
- package/dist/plugin/tool-execute-after.d.ts +15 -9
- package/dist/plugin/tool-registry.d.ts +1 -2
- package/dist/plugin-handlers/mcp-config-handler.d.ts +3 -0
- package/dist/shared/index.d.ts +1 -0
- package/dist/shared/prompt-async-gate.d.ts +13 -1
- package/dist/shared/prompt-failure-classifier.d.ts +9 -0
- package/dist/shared/prompt-timeout-context.d.ts +1 -0
- package/dist/tools/delegate-task/sync-prompt-sender.d.ts +1 -2
- package/dist/tools/index.d.ts +0 -1
- package/package.json +38 -28
- package/packages/ast-grep-mcp/dist/cli.js +861 -0
- package/packages/lsp-tools-mcp/dist/cli.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/cli.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.js +1 -2
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.d.ts +1 -10
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js +55 -10
- package/packages/lsp-tools-mcp/dist/lsp/connection.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/connection.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/errors.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/errors.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/formatters.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/formatters.js +7 -10
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.js +10 -11
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/manager.d.ts +1 -3
- package/packages/lsp-tools-mcp/dist/lsp/manager.js +6 -23
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.d.ts +1 -0
- package/packages/lsp-tools-mcp/dist/lsp/process-signal-cleanup.js +17 -0
- package/packages/lsp-tools-mcp/dist/lsp/process.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/process.js +41 -12
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.js +3 -4
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.js +18 -7
- package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/transport.js +20 -11
- package/packages/lsp-tools-mcp/dist/lsp/types.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/types.js +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/utils.d.ts +0 -2
- package/packages/lsp-tools-mcp/dist/lsp/utils.js +0 -8
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js +0 -1
- package/packages/lsp-tools-mcp/dist/mcp.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/mcp.js +14 -14
- package/packages/lsp-tools-mcp/dist/tools.d.ts +0 -1
- package/packages/lsp-tools-mcp/dist/tools.js +21 -14
- package/dist/tools/ast-grep/cli-binary-path-resolution.d.ts +0 -5
- package/dist/tools/ast-grep/cli.d.ts +0 -12
- package/dist/tools/ast-grep/constants.d.ts +0 -5
- package/dist/tools/ast-grep/downloader.d.ts +0 -5
- package/dist/tools/ast-grep/environment-check.d.ts +0 -20
- package/dist/tools/ast-grep/index.d.ts +0 -5
- package/dist/tools/ast-grep/language-support.d.ts +0 -6
- package/dist/tools/ast-grep/pattern-hints.d.ts +0 -4
- package/dist/tools/ast-grep/process-output-timeout.d.ts +0 -12
- package/dist/tools/ast-grep/result-formatter.d.ts +0 -5
- package/dist/tools/ast-grep/sg-cli-path.d.ts +0 -3
- package/dist/tools/ast-grep/sg-compact-json-output.d.ts +0 -2
- package/dist/tools/ast-grep/tool-descriptions.d.ts +0 -3
- package/dist/tools/ast-grep/tools.d.ts +0 -3
- package/dist/tools/ast-grep/types.d.ts +0 -58
- package/packages/lsp-tools-mcp/dist/cli.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/cli.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/cleanup-errors.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client-wrapper.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/client.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/config-loader.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/connection.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/connection.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/constants.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/directory-diagnostics.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/errors.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/errors.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/formatters.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/formatters.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/infer-extension.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/json-rpc-connection.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/language-mappings.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/manager.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/manager.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/process.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/process.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-definitions.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-installation.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/server-resolution.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/transport.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/transport.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/types.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/types.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/utils.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/utils.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/lsp/workspace-edit.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/mcp.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/mcp.js.map +0 -1
- package/packages/lsp-tools-mcp/dist/tools.d.ts.map +0 -1
- package/packages/lsp-tools-mcp/dist/tools.js.map +0 -1
|
@@ -63,7 +63,7 @@ export declare class ParentWakeNotifier {
|
|
|
63
63
|
private getParentWakeMessageFinish;
|
|
64
64
|
private getParentWakeMessageCreatedAt;
|
|
65
65
|
private parentWakePartIsWaitingOnTool;
|
|
66
|
-
private
|
|
66
|
+
private latestAssistantToolWaitState;
|
|
67
67
|
private parentWakeMessageHasOutput;
|
|
68
68
|
private parentWakeMessageContainsNotification;
|
|
69
69
|
private isUserMessageInProgress;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { AgentsMdCache } from "@oh-my-opencode/rules-core";
|
|
1
2
|
export declare function resolveFilePath(rootDirectory: string, path: string): string | null;
|
|
2
3
|
export declare function findAgentsMdUp(input: {
|
|
3
|
-
startDir: string;
|
|
4
|
-
rootDir: string;
|
|
4
|
+
readonly startDir: string;
|
|
5
|
+
readonly rootDir: string;
|
|
6
|
+
readonly cache?: AgentsMdCache;
|
|
5
7
|
}): Promise<string[]>;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
import type { AgentsMdCache } from "@oh-my-opencode/rules-core";
|
|
2
3
|
import type { createDynamicTruncator } from "../../shared/dynamic-truncator";
|
|
3
4
|
type DynamicTruncator = ReturnType<typeof createDynamicTruncator>;
|
|
4
5
|
export declare function processFilePathForAgentsInjection(input: {
|
|
5
6
|
ctx: PluginInput;
|
|
6
7
|
truncator: DynamicTruncator;
|
|
7
8
|
sessionCaches: Map<string, Set<string>>;
|
|
9
|
+
agentsMdCache?: AgentsMdCache;
|
|
8
10
|
filePath: string;
|
|
9
11
|
sessionID: string;
|
|
10
12
|
output: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { statSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
|
-
import type { FindRuleFilesOptions } from "./rule-file-finder";
|
|
4
|
-
import { createContentHash, isDuplicateByContentHash, isDuplicateByRealPath, shouldApplyRule } from "./matcher";
|
|
5
|
-
import { saveInjectedRules } from "./storage";
|
|
6
3
|
import type { SessionInjectedRulesCache } from "./cache";
|
|
4
|
+
import { createContentHash, isDuplicateByContentHash, isDuplicateByRealPath, shouldApplyRule } from "./matcher";
|
|
5
|
+
import type { FindRuleFilesOptions } from "./rule-file-finder";
|
|
7
6
|
import type { RuleScanCache } from "./rule-scan-cache";
|
|
7
|
+
import { saveInjectedRules } from "./storage";
|
|
8
8
|
type ToolExecuteOutput = {
|
|
9
9
|
title: string;
|
|
10
10
|
output: string;
|
|
@@ -23,6 +23,9 @@ export interface ParsedRuleCacheStats {
|
|
|
23
23
|
}
|
|
24
24
|
export declare function clearParsedRuleCache(): void;
|
|
25
25
|
export declare function getParsedRuleCacheStats(): ParsedRuleCacheStats;
|
|
26
|
+
export interface TranscriptHydrationHook {
|
|
27
|
+
hydrateSession(sessionID: string): Promise<ReadonlySet<string>>;
|
|
28
|
+
}
|
|
26
29
|
export declare function createRuleInjectionProcessor(deps: {
|
|
27
30
|
workspaceDirectory: string;
|
|
28
31
|
truncator: DynamicTruncator;
|
|
@@ -37,6 +40,7 @@ export declare function createRuleInjectionProcessor(deps: {
|
|
|
37
40
|
createContentHash?: typeof createContentHash;
|
|
38
41
|
isDuplicateByContentHash?: typeof isDuplicateByContentHash;
|
|
39
42
|
saveInjectedRules?: typeof saveInjectedRules;
|
|
43
|
+
transcriptHydration?: TranscriptHydrationHook;
|
|
40
44
|
}): {
|
|
41
45
|
processFilePathForInjection: (filePath: string, sessionID: string, output: ToolExecuteOutput) => Promise<void>;
|
|
42
46
|
};
|
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
applies: boolean;
|
|
4
|
-
reason?: string;
|
|
5
|
-
}
|
|
1
|
+
export { createContentHash, getMatcherCacheStats, isDuplicateByContentHash, isDuplicateByRealPath, resetMatcherCache, shouldApplyRule, } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export type { MatchResult } from "@oh-my-opencode/rules-core";
|
|
6
3
|
export interface MatcherCacheStats {
|
|
7
|
-
entries: number;
|
|
4
|
+
readonly entries: number;
|
|
8
5
|
}
|
|
9
|
-
export declare function resetMatcherCache(): void;
|
|
10
|
-
export declare function getMatcherCacheStats(): MatcherCacheStats;
|
|
11
|
-
/**
|
|
12
|
-
* Check if a rule should apply to the current file based on metadata
|
|
13
|
-
*/
|
|
14
|
-
export declare function shouldApplyRule(metadata: RuleMetadata, currentFilePath: string, projectRoot: string | null): MatchResult;
|
|
15
|
-
/**
|
|
16
|
-
* Check if realPath already exists in cache (symlink deduplication)
|
|
17
|
-
*/
|
|
18
|
-
export declare function isDuplicateByRealPath(realPath: string, cache: Set<string>): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Create SHA-256 hash of content, truncated to 16 chars
|
|
21
|
-
*/
|
|
22
|
-
export declare function createContentHash(content: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Check if content hash already exists in cache
|
|
25
|
-
*/
|
|
26
|
-
export declare function isDuplicateByContentHash(hash: string, cache: Set<string>): boolean;
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
metadata: RuleMetadata;
|
|
4
|
-
body: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Parse YAML frontmatter from rule file content
|
|
8
|
-
* Supports:
|
|
9
|
-
* - Single string: globs: "**\/*.py"
|
|
10
|
-
* - Inline array: globs: ["**\/*.py", "src/**\/*.ts"]
|
|
11
|
-
* - Multi-line array:
|
|
12
|
-
* globs:
|
|
13
|
-
* - "**\/*.py"
|
|
14
|
-
* - "src/**\/*.ts"
|
|
15
|
-
* - Comma-separated: globs: "**\/*.py, src/**\/*.ts"
|
|
16
|
-
* - Claude Code 'paths' field (alias for globs)
|
|
17
|
-
*/
|
|
18
|
-
export declare function parseRuleFrontmatter(content: string): RuleFrontmatterResult;
|
|
1
|
+
export { parseRuleFrontmatter } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export type { RuleFrontmatterResult } from "@oh-my-opencode/rules-core";
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
/**
|
|
3
|
-
* Find project root by walking up from startPath.
|
|
4
|
-
* Checks for PROJECT_MARKERS (.git, pyproject.toml, package.json, etc.)
|
|
5
|
-
*
|
|
6
|
-
* Memoizes every directory visited during the walk so subsequent lookups for
|
|
7
|
-
* any descendant path resolve in O(1) without re-running marker existsSync
|
|
8
|
-
* probes.
|
|
9
|
-
*
|
|
10
|
-
* @param startPath - Starting path to search from (file or directory)
|
|
11
|
-
* @returns Project root path or null if not found
|
|
12
|
-
*/
|
|
13
|
-
export declare function findProjectRoot(startPath: string): string | null;
|
|
1
|
+
export { clearProjectRootCache, findProjectRoot } from "@oh-my-opencode/rules-core";
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Calculate directory distance between a rule file and current file.
|
|
3
|
-
* Distance is based on common ancestor within project root.
|
|
4
|
-
*
|
|
5
|
-
* @param rulePath - Path to the rule file
|
|
6
|
-
* @param currentFile - Path to the current file being edited
|
|
7
|
-
* @param projectRoot - Project root for relative path calculation
|
|
8
|
-
* @returns Distance (0 = same directory, higher = further)
|
|
9
|
-
*/
|
|
10
|
-
export declare function calculateDistance(rulePath: string, currentFile: string, projectRoot: string | null): number;
|
|
1
|
+
export { calculateDistance } from "@oh-my-opencode/rules-core";
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export interface FindRuleFilesOptions {
|
|
4
|
-
skipClaudeUserRules?: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function findRuleFiles(projectRoot: string | null, homeDir: string, currentFile: string, options?: FindRuleFilesOptions, cache?: RuleScanCache): RuleFileCandidate[];
|
|
1
|
+
export { findRuleFiles } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export type { FindRuleFilesOptions } from "@oh-my-opencode/rules-core";
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @param dir - Directory to search
|
|
5
|
-
* @param results - Array to accumulate results
|
|
6
|
-
*/
|
|
1
|
+
import { safeRealpathSync } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export { safeRealpathSync };
|
|
7
3
|
export declare function findRuleFilesRecursive(dir: string, results: string[]): void;
|
|
8
|
-
/**
|
|
9
|
-
* Resolve symlinks safely with fallback to original path
|
|
10
|
-
*
|
|
11
|
-
* @param filePath - Path to resolve
|
|
12
|
-
* @returns Real path or original path if resolution fails
|
|
13
|
-
*/
|
|
14
|
-
export declare function safeRealpathSync(filePath: string): string;
|
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export type DirectoryScanEntry
|
|
3
|
-
path: string;
|
|
4
|
-
realPath: string;
|
|
5
|
-
};
|
|
6
|
-
export type RuleScanCache = {
|
|
7
|
-
get: (key: string) => RuleFileCandidate[] | undefined;
|
|
8
|
-
set: (key: string, value: RuleFileCandidate[]) => void;
|
|
9
|
-
getDirScan: (dir: string) => DirectoryScanEntry[] | undefined;
|
|
10
|
-
setDirScan: (dir: string, entries: DirectoryScanEntry[]) => void;
|
|
11
|
-
clear: () => void;
|
|
12
|
-
};
|
|
13
|
-
export declare function createRuleScanCache(): RuleScanCache;
|
|
1
|
+
export { createRuleScanCache } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export type { DirectoryScanEntry, RuleScanCache } from "@oh-my-opencode/rules-core";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { PluginInput } from "@opencode-ai/plugin";
|
|
2
|
+
export interface TranscriptHydrationDeps {
|
|
3
|
+
readonly client: PluginInput["client"];
|
|
4
|
+
}
|
|
5
|
+
export interface TranscriptHydrationStore {
|
|
6
|
+
hydrateSession(sessionID: string): Promise<ReadonlySet<string>>;
|
|
7
|
+
getHydratedRelativePaths(sessionID: string): ReadonlySet<string>;
|
|
8
|
+
clearSession(sessionID: string): void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Builds an in-memory store keyed by sessionID that lazily scans the session
|
|
12
|
+
* transcript for `[Rule: <relativePath>]` markers and exposes the set of
|
|
13
|
+
* already-injected rule relative paths. The store is consulted by the
|
|
14
|
+
* injector before emitting a rule so a process that lost its persisted cache
|
|
15
|
+
* file but whose model context still contains prior `[Rule: ...]` markers
|
|
16
|
+
* does not re-inject duplicates.
|
|
17
|
+
*/
|
|
18
|
+
export declare function createTranscriptHydrationStore(deps: TranscriptHydrationDeps): TranscriptHydrationStore;
|
|
@@ -1,54 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Supports both Claude Code format (globs, paths) and GitHub Copilot format (applyTo)
|
|
4
|
-
* @see https://docs.anthropic.com/en/docs/claude-code/settings#rule-files
|
|
5
|
-
* @see https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot
|
|
6
|
-
*/
|
|
7
|
-
export interface RuleMetadata {
|
|
8
|
-
description?: string;
|
|
9
|
-
globs?: string | string[];
|
|
10
|
-
alwaysApply?: boolean;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Rule information with path context and content
|
|
14
|
-
*/
|
|
1
|
+
import type { RuleFileCandidate, RuleMetadata } from "@oh-my-opencode/rules-core";
|
|
2
|
+
export type { RuleFileCandidate, RuleMetadata };
|
|
15
3
|
export interface RuleInfo {
|
|
16
|
-
/** Absolute path to the rule file */
|
|
17
4
|
path: string;
|
|
18
|
-
/** Path relative to project root */
|
|
19
5
|
relativePath: string;
|
|
20
|
-
/** Directory distance from target file (0 = same dir) */
|
|
21
6
|
distance: number;
|
|
22
|
-
/** Rule file content (without frontmatter) */
|
|
23
7
|
content: string;
|
|
24
|
-
/** SHA-256 hash of content for deduplication */
|
|
25
8
|
contentHash: string;
|
|
26
|
-
/** Parsed frontmatter metadata */
|
|
27
9
|
metadata: RuleMetadata;
|
|
28
|
-
/** Why this rule matched (e.g., "alwaysApply", "glob: *.ts", "path match") */
|
|
29
10
|
matchReason: string;
|
|
30
|
-
/** Real path after symlink resolution (for duplicate detection) */
|
|
31
11
|
realPath: string;
|
|
32
12
|
}
|
|
33
|
-
/**
|
|
34
|
-
* Rule file candidate with discovery context
|
|
35
|
-
*/
|
|
36
|
-
export interface RuleFileCandidate {
|
|
37
|
-
path: string;
|
|
38
|
-
realPath: string;
|
|
39
|
-
isGlobal: boolean;
|
|
40
|
-
distance: number;
|
|
41
|
-
/** Single-file rules (e.g., .github/copilot-instructions.md) always apply without frontmatter */
|
|
42
|
-
isSingleFile?: boolean;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Session storage for injected rules tracking
|
|
46
|
-
*/
|
|
47
13
|
export interface InjectedRulesData {
|
|
48
14
|
sessionID: string;
|
|
49
|
-
/** Content hashes of already injected rules */
|
|
50
15
|
injectedHashes: string[];
|
|
51
|
-
/** Real paths of already injected rules (for symlink deduplication) */
|
|
52
16
|
injectedRealPaths: string[];
|
|
53
17
|
updatedAt: number;
|
|
54
18
|
}
|
|
@@ -6,5 +6,18 @@ type HookInput = {
|
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
export type HookImpl = (input: HookInput) => Promise<void>;
|
|
9
|
-
|
|
9
|
+
type TeamMemberErrorHandlerDeps = {
|
|
10
|
+
client?: {
|
|
11
|
+
session?: {
|
|
12
|
+
status?: () => Promise<unknown>;
|
|
13
|
+
messages?: (input: {
|
|
14
|
+
path: {
|
|
15
|
+
id: string;
|
|
16
|
+
};
|
|
17
|
+
}) => Promise<unknown>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
settleMs?: number;
|
|
21
|
+
};
|
|
22
|
+
export declare function createTeamMemberErrorHandler(config: TeamModeConfig, deps?: TeamMemberErrorHandlerDeps): HookImpl;
|
|
10
23
|
export {};
|
|
@@ -13,27 +13,6 @@ type BabysitterContext = {
|
|
|
13
13
|
}) => Promise<{
|
|
14
14
|
data?: unknown;
|
|
15
15
|
} | unknown[]>;
|
|
16
|
-
prompt: (args: {
|
|
17
|
-
path: {
|
|
18
|
-
id: string;
|
|
19
|
-
};
|
|
20
|
-
body: {
|
|
21
|
-
parts: Array<{
|
|
22
|
-
type: "text";
|
|
23
|
-
text: string;
|
|
24
|
-
}>;
|
|
25
|
-
agent?: string;
|
|
26
|
-
variant?: string;
|
|
27
|
-
model?: {
|
|
28
|
-
providerID: string;
|
|
29
|
-
modelID: string;
|
|
30
|
-
};
|
|
31
|
-
tools?: Record<string, boolean>;
|
|
32
|
-
};
|
|
33
|
-
query?: {
|
|
34
|
-
directory?: string;
|
|
35
|
-
};
|
|
36
|
-
}) => Promise<unknown>;
|
|
37
16
|
promptAsync: (args: {
|
|
38
17
|
path: {
|
|
39
18
|
id: string;
|