oh-my-openidea 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 +130 -0
- package/dist/agents/architect.d.ts +2 -0
- package/dist/agents/critic.d.ts +2 -0
- package/dist/agents/designer.d.ts +2 -0
- package/dist/agents/explorer.d.ts +2 -0
- package/dist/agents/fixer.d.ts +2 -0
- package/dist/agents/index.d.ts +22 -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/surveyor.d.ts +2 -0
- package/dist/agents/synthesizer.d.ts +2 -0
- package/dist/agents/writer.d.ts +2 -0
- package/dist/background/background-manager.d.ts +175 -0
- package/dist/background/index.d.ts +2 -0
- package/dist/background/tmux-session-manager.d.ts +63 -0
- package/dist/cli/chutes-selection.d.ts +3 -0
- package/dist/cli/config-io.d.ts +26 -0
- package/dist/cli/config-manager.d.ts +12 -0
- package/dist/cli/custom-skills.d.ts +29 -0
- package/dist/cli/dynamic-model-selection.d.ts +14 -0
- package/dist/cli/external-rankings.d.ts +8 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +17102 -0
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/model-key-normalization.d.ts +1 -0
- package/dist/cli/model-selection.d.ts +30 -0
- package/dist/cli/opencode-models.d.ts +18 -0
- package/dist/cli/opencode-selection.d.ts +3 -0
- package/dist/cli/paths.d.ts +9 -0
- package/dist/cli/precedence-resolver.d.ts +16 -0
- package/dist/cli/providers.d.ts +204 -0
- package/dist/cli/research.d.ts +2 -0
- package/dist/cli/scoring-v2/engine.d.ts +4 -0
- package/dist/cli/scoring-v2/features.d.ts +3 -0
- package/dist/cli/scoring-v2/index.d.ts +4 -0
- package/dist/cli/scoring-v2/types.d.ts +17 -0
- package/dist/cli/scoring-v2/weights.d.ts +2 -0
- package/dist/cli/skills.d.ts +52 -0
- package/dist/cli/system.d.ts +6 -0
- package/dist/cli/types.d.ts +140 -0
- package/dist/config/agent-mcps.d.ts +15 -0
- package/dist/config/constants.d.ts +14 -0
- package/dist/config/index.d.ts +4 -0
- package/dist/config/loader.d.ts +30 -0
- package/dist/config/schema.d.ts +218 -0
- package/dist/config/utils.d.ts +10 -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/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/idea-quality-gate/index.d.ts +22 -0
- package/dist/hooks/index.d.ts +7 -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 +25 -0
- package/dist/hooks/post-read-nudge/index.d.ts +18 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +29330 -0
- package/dist/mcp/arxiv.d.ts +10 -0
- package/dist/mcp/context7.d.ts +6 -0
- package/dist/mcp/google-scholar.d.ts +10 -0
- package/dist/mcp/grep-app.d.ts +6 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/semantic-scholar.d.ts +12 -0
- package/dist/mcp/types.d.ts +12 -0
- package/dist/mcp/websearch.d.ts +6 -0
- package/dist/research/connectors.d.ts +6 -0
- package/dist/research/defaults.d.ts +2 -0
- package/dist/research/index.d.ts +4 -0
- package/dist/research/pipeline.d.ts +9 -0
- package/dist/research/store.d.ts +31 -0
- package/dist/research/text.d.ts +8 -0
- package/dist/research/types.d.ts +194 -0
- package/dist/tools/arxiv/index.d.ts +7 -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/google-scholar/index.d.ts +8 -0
- package/dist/tools/grep/cli.d.ts +3 -0
- package/dist/tools/grep/constants.d.ts +18 -0
- package/dist/tools/grep/downloader.d.ts +3 -0
- package/dist/tools/grep/index.d.ts +5 -0
- package/dist/tools/grep/tools.d.ts +2 -0
- package/dist/tools/grep/types.d.ts +35 -0
- package/dist/tools/grep/utils.d.ts +2 -0
- package/dist/tools/idea-store/index.d.ts +7 -0
- package/dist/tools/index.d.ts +6 -0
- package/dist/tools/lsp/client.d.ts +42 -0
- package/dist/tools/lsp/config.d.ts +4 -0
- package/dist/tools/lsp/constants.d.ts +8 -0
- package/dist/tools/lsp/index.d.ts +3 -0
- package/dist/tools/lsp/tools.d.ts +5 -0
- package/dist/tools/lsp/types.d.ts +28 -0
- package/dist/tools/lsp/utils.d.ts +21 -0
- package/dist/tools/paper-reader/index.d.ts +8 -0
- package/dist/tools/research.d.ts +3 -0
- package/dist/tools/semantic-scholar/index.d.ts +12 -0
- package/dist/utils/agent-variant.d.ts +47 -0
- package/dist/utils/env.d.ts +1 -0
- package/dist/utils/index.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/package.json +66 -0
- package/src/skills/experiment-design/SKILL.md +153 -0
- package/src/skills/hypothesis-generation/SKILL.md +102 -0
- package/src/skills/idea-critique/SKILL.md +129 -0
- package/src/skills/literature-review/SKILL.md +95 -0
- package/src/skills/paper-outline/SKILL.md +137 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RemoteMcpConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* arXiv MCP via the Community arxiv-mcp-server (smithery).
|
|
4
|
+
* Provides paper search, PDF reading, and paper info retrieval.
|
|
5
|
+
* @see https://smithery.ai/server/@joshuarileydev/arxiv-mcp-server
|
|
6
|
+
*
|
|
7
|
+
* Falls back to remote hosted instance if available.
|
|
8
|
+
* No API key required — arXiv API is free.
|
|
9
|
+
*/
|
|
10
|
+
export declare const arxiv: RemoteMcpConfig;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { RemoteMcpConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Google Scholar search via the community google-scholar-mcp-server.
|
|
4
|
+
* Provides broad academic search coverage, useful for finding surveys and classics.
|
|
5
|
+
*
|
|
6
|
+
* Requires SERPAPI_KEY environment variable for the underlying SerpAPI service.
|
|
7
|
+
* If not set, this MCP should be disabled in config via disabled_mcps.
|
|
8
|
+
* @see https://serpapi.com/google-scholar-api
|
|
9
|
+
*/
|
|
10
|
+
export declare const google_scholar: RemoteMcpConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { McpConfig } from './types';
|
|
2
|
+
export type { LocalMcpConfig, McpConfig, RemoteMcpConfig } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Creates MCP configurations, excluding disabled ones
|
|
5
|
+
*/
|
|
6
|
+
export declare function createBuiltinMcps(disabledMcps?: readonly string[]): Record<string, McpConfig>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RemoteMcpConfig, LocalMcpConfig } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Semantic Scholar MCP.
|
|
4
|
+
* Searches papers, retrieves citation graphs and paper details via the free S2 API.
|
|
5
|
+
*
|
|
6
|
+
* Uses the community semantic-scholar-mcp-server via Smithery.
|
|
7
|
+
* Optionally set SEMANTIC_SCHOLAR_API_KEY for higher rate limits.
|
|
8
|
+
* @see https://www.semanticscholar.org/product/api
|
|
9
|
+
*/
|
|
10
|
+
type McpConfig = RemoteMcpConfig | LocalMcpConfig;
|
|
11
|
+
export declare const semantic_scholar: McpConfig;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RemoteMcpConfig = {
|
|
2
|
+
type: 'remote';
|
|
3
|
+
url: string;
|
|
4
|
+
headers?: Record<string, string>;
|
|
5
|
+
oauth?: false;
|
|
6
|
+
};
|
|
7
|
+
export type LocalMcpConfig = {
|
|
8
|
+
type: 'local';
|
|
9
|
+
command: string[];
|
|
10
|
+
environment?: Record<string, string>;
|
|
11
|
+
};
|
|
12
|
+
export type McpConfig = RemoteMcpConfig | LocalMcpConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SourceRecord } from './types';
|
|
2
|
+
export declare function ingestLocalSources(root: string, globs: string[]): Promise<SourceRecord[]>;
|
|
3
|
+
export declare function ingestWebSources(queries: string[], maxResults?: number): Promise<{
|
|
4
|
+
sources: SourceRecord[];
|
|
5
|
+
warnings: string[];
|
|
6
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CritiqueResearchOptions, ExportResearchOptions, ExportResult, IdeaBrief, IdeaScorecard, IdeateResearchOptions, IngestResearchOptions, IngestResult, InitResearchOptions, LandscapeMap, MapResearchOptions, PipelineRun, RankResearchOptions, RankResult, ResearchConfig, ResearchProject, RunResearchOptions } from './types';
|
|
2
|
+
export declare function initResearchProject(root: string, options?: InitResearchOptions, researchConfig?: Partial<ResearchConfig>): ResearchProject;
|
|
3
|
+
export declare function ingestResearchSources(root: string, options?: IngestResearchOptions, researchConfig?: Partial<ResearchConfig>): Promise<IngestResult>;
|
|
4
|
+
export declare function mapResearchLandscape(root: string, options?: MapResearchOptions, researchConfig?: Partial<ResearchConfig>): LandscapeMap;
|
|
5
|
+
export declare function ideateResearchIdeas(root: string, options?: IdeateResearchOptions, researchConfig?: Partial<ResearchConfig>): IdeaBrief[];
|
|
6
|
+
export declare function critiqueResearchIdeas(root: string, options?: CritiqueResearchOptions, researchConfig?: Partial<ResearchConfig>): IdeaScorecard[];
|
|
7
|
+
export declare function rankResearchIdeas(root: string, options?: RankResearchOptions, researchConfig?: Partial<ResearchConfig>): RankResult;
|
|
8
|
+
export declare function exportResearchArtifacts(root: string, options?: ExportResearchOptions, researchConfig?: Partial<ResearchConfig>): ExportResult;
|
|
9
|
+
export declare function runResearchPipeline(root: string, options?: RunResearchOptions, researchConfig?: Partial<ResearchConfig>): Promise<PipelineRun>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { IdeaBrief, IdeaScorecard, LandscapeMap, PipelineRun, ResearchProject, SourceRecord } from './types';
|
|
2
|
+
export declare function hashContent(value: string): string;
|
|
3
|
+
export declare function getResearchDir(root: string): string;
|
|
4
|
+
export declare function getResearchProjectPath(root: string): string;
|
|
5
|
+
export declare function getResearchSourcesPath(root: string): string;
|
|
6
|
+
export declare function getResearchLandscapePath(root: string): string;
|
|
7
|
+
export declare function getResearchLandscapeJsonPath(root: string): string;
|
|
8
|
+
export declare function getResearchIdeasDir(root: string): string;
|
|
9
|
+
export declare function getResearchIdeaIndexPath(root: string): string;
|
|
10
|
+
export declare function getResearchEvaluationsDir(root: string): string;
|
|
11
|
+
export declare function getResearchRunsDir(root: string): string;
|
|
12
|
+
export declare function getResearchExportsDir(root: string): string;
|
|
13
|
+
export declare function ensureResearchWorkspace(root: string): void;
|
|
14
|
+
export declare function writeJson(filePath: string, value: unknown): void;
|
|
15
|
+
export declare function writeText(filePath: string, content: string): void;
|
|
16
|
+
export declare function readJson<T>(filePath: string): T | null;
|
|
17
|
+
export declare function readJsonLines<T>(filePath: string): T[];
|
|
18
|
+
export declare function writeJsonLines(filePath: string, values: unknown[]): void;
|
|
19
|
+
export declare function readResearchProject(root: string): ResearchProject | null;
|
|
20
|
+
export declare function writeResearchProject(root: string, project: ResearchProject): void;
|
|
21
|
+
export declare function readSourceRecords(root: string): SourceRecord[];
|
|
22
|
+
export declare function writeSourceRecords(root: string, sources: SourceRecord[]): void;
|
|
23
|
+
export declare function writeLandscape(root: string, landscape: LandscapeMap): void;
|
|
24
|
+
export declare function readLandscape(root: string): LandscapeMap | null;
|
|
25
|
+
export declare function writeLandscapeMarkdown(root: string, content: string): void;
|
|
26
|
+
export declare function writeIdeaBrief(root: string, idea: IdeaBrief, content: string): void;
|
|
27
|
+
export declare function readIdeaIndex(root: string): IdeaBrief[];
|
|
28
|
+
export declare function writeIdeaIndex(root: string, ideas: IdeaBrief[]): void;
|
|
29
|
+
export declare function writeIdeaScorecard(root: string, scorecard: IdeaScorecard): void;
|
|
30
|
+
export declare function readIdeaScorecards(root: string): IdeaScorecard[];
|
|
31
|
+
export declare function writeRun(root: string, run: PipelineRun): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function normalizeWhitespace(value: string): string;
|
|
2
|
+
export declare function splitSentences(value: string): string[];
|
|
3
|
+
export declare function summarizeText(value: string, maxSentences?: number): string;
|
|
4
|
+
export declare function extractTitleFromContent(content: string, fallback: string): string;
|
|
5
|
+
export declare function extractKeywords(content: string, limit?: number): string[];
|
|
6
|
+
export declare function slugify(value: string): string;
|
|
7
|
+
export declare function truncate(value: string, maxLength: number): string;
|
|
8
|
+
export declare function collectTaggedSentences(content: string, markers: readonly string[], limit?: number): string[];
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
export declare const RESEARCH_STAGE_NAMES: readonly ["init", "ingest", "map", "ideate", "critique", "rank", "export"];
|
|
2
|
+
export type ResearchStageName = (typeof RESEARCH_STAGE_NAMES)[number];
|
|
3
|
+
export type ResearchBehaviorPreset = 'research' | 'code-research' | 'legacy-coding';
|
|
4
|
+
export interface ResearchWorkspaceConfig {
|
|
5
|
+
title: string;
|
|
6
|
+
objective: string;
|
|
7
|
+
constraints: string[];
|
|
8
|
+
audience: string;
|
|
9
|
+
successCriteria: string[];
|
|
10
|
+
}
|
|
11
|
+
export interface ResearchSourcesConfig {
|
|
12
|
+
connectors: string[];
|
|
13
|
+
localGlobs: string[];
|
|
14
|
+
webQueries: string[];
|
|
15
|
+
citationPolicy: 'required' | 'optional';
|
|
16
|
+
refreshBehavior: 'append' | 'replace';
|
|
17
|
+
}
|
|
18
|
+
export interface ResearchPipelineConfig {
|
|
19
|
+
enabledStages: ResearchStageName[];
|
|
20
|
+
ideaCount: number;
|
|
21
|
+
critiquePasses: number;
|
|
22
|
+
promotionThreshold: number;
|
|
23
|
+
topK: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ResearchScoringConfig {
|
|
26
|
+
novelty: number;
|
|
27
|
+
feasibility: number;
|
|
28
|
+
impact: number;
|
|
29
|
+
evidenceCoverage: number;
|
|
30
|
+
strategicFit: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ResearchTemplatesConfig {
|
|
33
|
+
ideaBrief: string;
|
|
34
|
+
scorecard: string;
|
|
35
|
+
exportFormat: 'markdown' | 'json' | 'both';
|
|
36
|
+
}
|
|
37
|
+
export interface ResearchConfig {
|
|
38
|
+
behaviorPreset: ResearchBehaviorPreset;
|
|
39
|
+
codeTools: boolean;
|
|
40
|
+
workspace: ResearchWorkspaceConfig;
|
|
41
|
+
sources: ResearchSourcesConfig;
|
|
42
|
+
pipeline: ResearchPipelineConfig;
|
|
43
|
+
scoring: ResearchScoringConfig;
|
|
44
|
+
templates: ResearchTemplatesConfig;
|
|
45
|
+
}
|
|
46
|
+
export interface ResearchProject {
|
|
47
|
+
version: 1;
|
|
48
|
+
createdAt: string;
|
|
49
|
+
updatedAt: string;
|
|
50
|
+
workspace: ResearchWorkspaceConfig;
|
|
51
|
+
sources: ResearchSourcesConfig;
|
|
52
|
+
pipeline: ResearchPipelineConfig;
|
|
53
|
+
scoring: ResearchScoringConfig;
|
|
54
|
+
templates: ResearchTemplatesConfig;
|
|
55
|
+
}
|
|
56
|
+
export interface SourceRecord {
|
|
57
|
+
id: string;
|
|
58
|
+
sourceType: 'local' | 'web';
|
|
59
|
+
connector: string;
|
|
60
|
+
title: string;
|
|
61
|
+
citation: string;
|
|
62
|
+
capturedAt: string;
|
|
63
|
+
summary: string;
|
|
64
|
+
excerpt: string;
|
|
65
|
+
content: string;
|
|
66
|
+
tags: string[];
|
|
67
|
+
checksum: string;
|
|
68
|
+
path?: string;
|
|
69
|
+
url?: string;
|
|
70
|
+
query?: string;
|
|
71
|
+
publishedAt?: string;
|
|
72
|
+
}
|
|
73
|
+
export interface LandscapeTheme {
|
|
74
|
+
name: string;
|
|
75
|
+
keywords: string[];
|
|
76
|
+
summary: string;
|
|
77
|
+
sourceIds: string[];
|
|
78
|
+
}
|
|
79
|
+
export interface LandscapeGap {
|
|
80
|
+
title: string;
|
|
81
|
+
description: string;
|
|
82
|
+
sourceIds: string[];
|
|
83
|
+
}
|
|
84
|
+
export interface LandscapeTension {
|
|
85
|
+
title: string;
|
|
86
|
+
description: string;
|
|
87
|
+
sourceIds: string[];
|
|
88
|
+
}
|
|
89
|
+
export interface LandscapeOpportunity {
|
|
90
|
+
title: string;
|
|
91
|
+
rationale: string;
|
|
92
|
+
sourceIds: string[];
|
|
93
|
+
}
|
|
94
|
+
export interface LandscapeMap {
|
|
95
|
+
generatedAt: string;
|
|
96
|
+
summary: string;
|
|
97
|
+
sourceIds: string[];
|
|
98
|
+
themes: LandscapeTheme[];
|
|
99
|
+
gaps: LandscapeGap[];
|
|
100
|
+
tensions: LandscapeTension[];
|
|
101
|
+
opportunities: LandscapeOpportunity[];
|
|
102
|
+
}
|
|
103
|
+
export interface IdeaBrief {
|
|
104
|
+
id: string;
|
|
105
|
+
slug: string;
|
|
106
|
+
title: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
problem: string;
|
|
109
|
+
motivation: string;
|
|
110
|
+
hypothesis: string;
|
|
111
|
+
approach: string;
|
|
112
|
+
evaluationPlan: string;
|
|
113
|
+
risks: string[];
|
|
114
|
+
noveltyClaim: string;
|
|
115
|
+
citations: string[];
|
|
116
|
+
sourceIds: string[];
|
|
117
|
+
}
|
|
118
|
+
export interface IdeaScorecard {
|
|
119
|
+
ideaId: string;
|
|
120
|
+
generatedAt: string;
|
|
121
|
+
novelty: number;
|
|
122
|
+
feasibility: number;
|
|
123
|
+
impact: number;
|
|
124
|
+
evidenceCoverage: number;
|
|
125
|
+
strategicFit: number;
|
|
126
|
+
total: number;
|
|
127
|
+
strengths: string[];
|
|
128
|
+
risks: string[];
|
|
129
|
+
verdict: 'promote' | 'revise' | 'hold';
|
|
130
|
+
}
|
|
131
|
+
export interface RankedIdea {
|
|
132
|
+
ideaId: string;
|
|
133
|
+
title: string;
|
|
134
|
+
total: number;
|
|
135
|
+
verdict: IdeaScorecard['verdict'];
|
|
136
|
+
}
|
|
137
|
+
export interface PipelineRun {
|
|
138
|
+
id: string;
|
|
139
|
+
createdAt: string;
|
|
140
|
+
stages: ResearchStageName[];
|
|
141
|
+
counts: {
|
|
142
|
+
sources: number;
|
|
143
|
+
themes: number;
|
|
144
|
+
ideas: number;
|
|
145
|
+
evaluations: number;
|
|
146
|
+
};
|
|
147
|
+
outputs: Record<string, string>;
|
|
148
|
+
ranking: RankedIdea[];
|
|
149
|
+
warnings: string[];
|
|
150
|
+
}
|
|
151
|
+
export interface InitResearchOptions {
|
|
152
|
+
title?: string;
|
|
153
|
+
objective?: string;
|
|
154
|
+
audience?: string;
|
|
155
|
+
constraints?: string[];
|
|
156
|
+
successCriteria?: string[];
|
|
157
|
+
localGlobs?: string[];
|
|
158
|
+
webQueries?: string[];
|
|
159
|
+
}
|
|
160
|
+
export interface IngestResearchOptions {
|
|
161
|
+
localGlobs?: string[];
|
|
162
|
+
webQueries?: string[];
|
|
163
|
+
maxWebResults?: number;
|
|
164
|
+
}
|
|
165
|
+
export interface MapResearchOptions {
|
|
166
|
+
maxThemes?: number;
|
|
167
|
+
}
|
|
168
|
+
export interface IdeateResearchOptions {
|
|
169
|
+
count?: number;
|
|
170
|
+
}
|
|
171
|
+
export interface CritiqueResearchOptions {
|
|
172
|
+
ideaIds?: string[];
|
|
173
|
+
}
|
|
174
|
+
export interface RankResearchOptions {
|
|
175
|
+
topK?: number;
|
|
176
|
+
}
|
|
177
|
+
export interface ExportResearchOptions {
|
|
178
|
+
format?: 'markdown' | 'json' | 'both';
|
|
179
|
+
topK?: number;
|
|
180
|
+
name?: string;
|
|
181
|
+
}
|
|
182
|
+
export interface RunResearchOptions extends InitResearchOptions, IngestResearchOptions, MapResearchOptions, IdeateResearchOptions, RankResearchOptions, ExportResearchOptions {
|
|
183
|
+
stages?: ResearchStageName[];
|
|
184
|
+
}
|
|
185
|
+
export interface IngestResult {
|
|
186
|
+
sources: SourceRecord[];
|
|
187
|
+
warnings: string[];
|
|
188
|
+
}
|
|
189
|
+
export interface RankResult {
|
|
190
|
+
ranking: RankedIdea[];
|
|
191
|
+
}
|
|
192
|
+
export interface ExportResult {
|
|
193
|
+
files: string[];
|
|
194
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* Search arXiv preprints via the public arXiv API.
|
|
4
|
+
* No API key required. Returns paper metadata including arXiv IDs,
|
|
5
|
+
* titles, authors, abstracts, categories, and PDF links.
|
|
6
|
+
*/
|
|
7
|
+
export declare const arxiv_search: ToolDefinition;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CliLanguage, SgResult } from './types';
|
|
2
|
+
export interface RunOptions {
|
|
3
|
+
pattern: string;
|
|
4
|
+
lang: CliLanguage;
|
|
5
|
+
paths?: string[];
|
|
6
|
+
globs?: string[];
|
|
7
|
+
rewrite?: string;
|
|
8
|
+
context?: number;
|
|
9
|
+
updateAll?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function getAstGrepPath(): Promise<string | null>;
|
|
12
|
+
export declare function startBackgroundInit(): void;
|
|
13
|
+
export declare function runSg(options: RunOptions): Promise<SgResult>;
|
|
14
|
+
export declare function isCliAvailable(): boolean;
|
|
15
|
+
export declare function ensureCliAvailable(): Promise<boolean>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CLI_LANGUAGES } from './types';
|
|
2
|
+
export declare function findSgCliPathSync(): string | null;
|
|
3
|
+
export declare function getSgCliPath(): string;
|
|
4
|
+
export declare function setSgCliPath(path: string): void;
|
|
5
|
+
export { CLI_LANGUAGES };
|
|
6
|
+
export declare const DEFAULT_TIMEOUT_MS = 300000;
|
|
7
|
+
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
8
|
+
export declare const DEFAULT_MAX_MATCHES = 500;
|
|
9
|
+
export declare const LANG_EXTENSIONS: Record<string, string[]>;
|
|
10
|
+
export interface EnvironmentCheckResult {
|
|
11
|
+
cli: {
|
|
12
|
+
available: boolean;
|
|
13
|
+
path: string;
|
|
14
|
+
error?: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if ast-grep CLI is available.
|
|
19
|
+
* Call this at startup to provide early feedback about missing dependencies.
|
|
20
|
+
*/
|
|
21
|
+
export declare function checkEnvironment(): EnvironmentCheckResult;
|
|
22
|
+
/**
|
|
23
|
+
* Format environment check result as user-friendly message.
|
|
24
|
+
*/
|
|
25
|
+
export declare function formatEnvironmentCheck(result: EnvironmentCheckResult): string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function getCacheDir(): string;
|
|
2
|
+
export declare function getBinaryName(): string;
|
|
3
|
+
export declare function getCachedBinaryPath(): string | null;
|
|
4
|
+
export declare function downloadAstGrep(version?: string): Promise<string | null>;
|
|
5
|
+
export declare function ensureAstGrepBinary(): Promise<string | null>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
import { ast_grep_replace, ast_grep_search } from './tools';
|
|
3
|
+
export declare const builtinTools: Record<string, ToolDefinition>;
|
|
4
|
+
export { ast_grep_search, ast_grep_replace };
|
|
5
|
+
export { ensureCliAvailable, getAstGrepPath, isCliAvailable, startBackgroundInit, } from './cli';
|
|
6
|
+
export type { EnvironmentCheckResult } from './constants';
|
|
7
|
+
export { checkEnvironment, formatEnvironmentCheck } from './constants';
|
|
8
|
+
export { ensureAstGrepBinary, getCacheDir, getCachedBinaryPath, } from './downloader';
|
|
9
|
+
export type { CliLanguage, CliMatch, SgResult } from './types';
|
|
10
|
+
export { CLI_LANGUAGES } from './types';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const CLI_LANGUAGES: readonly ["bash", "c", "cpp", "csharp", "css", "elixir", "go", "haskell", "html", "java", "javascript", "json", "kotlin", "lua", "nix", "php", "python", "ruby", "rust", "scala", "solidity", "swift", "typescript", "tsx", "yaml"];
|
|
2
|
+
export type CliLanguage = (typeof CLI_LANGUAGES)[number];
|
|
3
|
+
export interface CliMatch {
|
|
4
|
+
file: string;
|
|
5
|
+
range: {
|
|
6
|
+
byteOffset: {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
};
|
|
10
|
+
start: {
|
|
11
|
+
line: number;
|
|
12
|
+
column: number;
|
|
13
|
+
};
|
|
14
|
+
end: {
|
|
15
|
+
line: number;
|
|
16
|
+
column: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
lines: string;
|
|
20
|
+
text: string;
|
|
21
|
+
replacement?: string;
|
|
22
|
+
language: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SgResult {
|
|
25
|
+
matches: CliMatch[];
|
|
26
|
+
totalMatches: number;
|
|
27
|
+
truncated: boolean;
|
|
28
|
+
truncatedReason?: 'timeout' | 'max_output_bytes' | 'max_matches';
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CliLanguage, SgResult } from './types';
|
|
2
|
+
export declare function formatSearchResult(result: SgResult): string;
|
|
3
|
+
export declare function formatReplaceResult(result: SgResult, isDryRun: boolean): string;
|
|
4
|
+
export declare function getEmptyResultHint(pattern: string, lang: CliLanguage): string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type PluginInput, type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
import type { BackgroundTaskManager } from '../background';
|
|
3
|
+
import type { PluginConfig } from '../config';
|
|
4
|
+
import type { TmuxConfig } from '../config/schema';
|
|
5
|
+
/**
|
|
6
|
+
* Creates background task management tools for the plugin.
|
|
7
|
+
* @param _ctx - Plugin input context
|
|
8
|
+
* @param manager - Background task manager for launching and tracking tasks
|
|
9
|
+
* @param _tmuxConfig - Optional tmux configuration for session management
|
|
10
|
+
* @param _pluginConfig - Optional plugin configuration for agent variants
|
|
11
|
+
* @returns Object containing background_task, background_output, and background_cancel tools
|
|
12
|
+
*/
|
|
13
|
+
export declare function createBackgroundTools(_ctx: PluginInput, manager: BackgroundTaskManager, _tmuxConfig?: TmuxConfig, _pluginConfig?: PluginConfig): Record<string, ToolDefinition>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* Search Google Scholar via the SerpAPI service.
|
|
4
|
+
* Requires SERPAPI_KEY environment variable.
|
|
5
|
+
* Useful for finding survey papers, highly-cited classics, and
|
|
6
|
+
* broad academic coverage not well indexed on arXiv/Semantic Scholar.
|
|
7
|
+
*/
|
|
8
|
+
export declare const google_scholar_search: ToolDefinition;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type GrepBackend = 'rg' | 'grep';
|
|
2
|
+
interface ResolvedCli {
|
|
3
|
+
path: string;
|
|
4
|
+
backend: GrepBackend;
|
|
5
|
+
}
|
|
6
|
+
export declare function getDataDir(): string;
|
|
7
|
+
export declare function resolveGrepCli(): ResolvedCli;
|
|
8
|
+
export declare function resolveGrepCliWithAutoInstall(): Promise<ResolvedCli>;
|
|
9
|
+
export declare const DEFAULT_MAX_DEPTH = 20;
|
|
10
|
+
export declare const DEFAULT_MAX_FILESIZE = "10M";
|
|
11
|
+
export declare const DEFAULT_MAX_COUNT = 500;
|
|
12
|
+
export declare const DEFAULT_MAX_COLUMNS = 1000;
|
|
13
|
+
export declare const DEFAULT_CONTEXT = 2;
|
|
14
|
+
export declare const DEFAULT_TIMEOUT_MS = 300000;
|
|
15
|
+
export declare const DEFAULT_MAX_OUTPUT_BYTES: number;
|
|
16
|
+
export declare const RG_SAFETY_FLAGS: readonly ["--no-follow", "--color=never", "--no-heading", "--line-number", "--with-filename"];
|
|
17
|
+
export declare const GREP_SAFETY_FLAGS: readonly ["-n", "-H", "--color=never"];
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { runRg, runRgCount } from './cli';
|
|
2
|
+
export { resolveGrepCli, resolveGrepCliWithAutoInstall } from './constants';
|
|
3
|
+
export { downloadAndInstallRipgrep, getInstalledRipgrepPath, } from './downloader';
|
|
4
|
+
export { grep } from './tools';
|
|
5
|
+
export type { CountResult, GrepMatch, GrepOptions, GrepResult } from './types';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface GrepMatch {
|
|
2
|
+
file: string;
|
|
3
|
+
line: number;
|
|
4
|
+
text: string;
|
|
5
|
+
}
|
|
6
|
+
export interface GrepResult {
|
|
7
|
+
matches: GrepMatch[];
|
|
8
|
+
totalMatches: number;
|
|
9
|
+
filesSearched: number;
|
|
10
|
+
truncated: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface CountResult {
|
|
14
|
+
file: string;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
export interface GrepOptions {
|
|
18
|
+
pattern: string;
|
|
19
|
+
paths?: string[];
|
|
20
|
+
globs?: string[];
|
|
21
|
+
excludeGlobs?: string[];
|
|
22
|
+
context?: number;
|
|
23
|
+
caseSensitive?: boolean;
|
|
24
|
+
wholeWord?: boolean;
|
|
25
|
+
fixedStrings?: boolean;
|
|
26
|
+
multiline?: boolean;
|
|
27
|
+
hidden?: boolean;
|
|
28
|
+
noIgnore?: boolean;
|
|
29
|
+
fileType?: string[];
|
|
30
|
+
maxDepth?: number;
|
|
31
|
+
maxFilesize?: string;
|
|
32
|
+
maxCount?: number;
|
|
33
|
+
maxColumns?: number;
|
|
34
|
+
timeout?: number;
|
|
35
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ToolDefinition } from '@opencode-ai/plugin';
|
|
2
|
+
/**
|
|
3
|
+
* Persistent local store for research ideas.
|
|
4
|
+
* Stores ideas with metadata (scores, status, related papers, methodology notes).
|
|
5
|
+
* Ideas are persisted to ~/.config/opencode/oh-my-openidea/ideas.json.
|
|
6
|
+
*/
|
|
7
|
+
export declare const idea_store: ToolDefinition;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { arxiv_search } from './arxiv';
|
|
2
|
+
export { createBackgroundTools } from './background';
|
|
3
|
+
export { citation_graph, semantic_scholar_search } from './semantic-scholar';
|
|
4
|
+
export { google_scholar_search } from './google-scholar';
|
|
5
|
+
export { idea_store } from './idea-store';
|
|
6
|
+
export { paper_reader } from './paper-reader';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Diagnostic, ResolvedServer } from './types';
|
|
2
|
+
declare class LSPServerManager {
|
|
3
|
+
private static instance;
|
|
4
|
+
private clients;
|
|
5
|
+
private cleanupInterval;
|
|
6
|
+
private readonly IDLE_TIMEOUT;
|
|
7
|
+
private constructor();
|
|
8
|
+
private registerProcessCleanup;
|
|
9
|
+
static getInstance(): LSPServerManager;
|
|
10
|
+
private getKey;
|
|
11
|
+
private startCleanupTimer;
|
|
12
|
+
private cleanupIdleClients;
|
|
13
|
+
getClient(root: string, server: ResolvedServer): Promise<LSPClient>;
|
|
14
|
+
releaseClient(root: string, serverId: string): void;
|
|
15
|
+
isServerInitializing(root: string, serverId: string): boolean;
|
|
16
|
+
stopAll(): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
export declare const lspManager: LSPServerManager;
|
|
19
|
+
export declare class LSPClient {
|
|
20
|
+
private root;
|
|
21
|
+
private server;
|
|
22
|
+
private proc;
|
|
23
|
+
private connection;
|
|
24
|
+
private openedFiles;
|
|
25
|
+
private stderrBuffer;
|
|
26
|
+
private processExited;
|
|
27
|
+
private diagnosticsStore;
|
|
28
|
+
constructor(root: string, server: ResolvedServer);
|
|
29
|
+
start(): Promise<void>;
|
|
30
|
+
private startStderrReading;
|
|
31
|
+
initialize(): Promise<void>;
|
|
32
|
+
openFile(filePath: string): Promise<void>;
|
|
33
|
+
definition(filePath: string, line: number, character: number): Promise<unknown>;
|
|
34
|
+
references(filePath: string, line: number, character: number, includeDeclaration?: boolean): Promise<unknown>;
|
|
35
|
+
diagnostics(filePath: string): Promise<{
|
|
36
|
+
items: Diagnostic[];
|
|
37
|
+
}>;
|
|
38
|
+
rename(filePath: string, line: number, character: number, newName: string): Promise<unknown>;
|
|
39
|
+
isAlive(): boolean;
|
|
40
|
+
stop(): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LSPServerConfig } from './types';
|
|
2
|
+
export declare const SYMBOL_KIND_MAP: Record<number, string>;
|
|
3
|
+
export declare const SEVERITY_MAP: Record<number, string>;
|
|
4
|
+
export declare const DEFAULT_MAX_REFERENCES = 200;
|
|
5
|
+
export declare const DEFAULT_MAX_DIAGNOSTICS = 200;
|
|
6
|
+
export declare const BUILTIN_SERVERS: Record<string, Omit<LSPServerConfig, 'id'>>;
|
|
7
|
+
export declare const LSP_INSTALL_HINTS: Record<string, string>;
|
|
8
|
+
export declare const EXT_TO_LANG: Record<string, string>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ToolDefinition } from '@opencode-ai/plugin/tool';
|
|
2
|
+
export declare const lsp_goto_definition: ToolDefinition;
|
|
3
|
+
export declare const lsp_find_references: ToolDefinition;
|
|
4
|
+
export declare const lsp_diagnostics: ToolDefinition;
|
|
5
|
+
export declare const lsp_rename: ToolDefinition;
|