miyabi-agent-sdk
Version:
Miyabi Autonomous Agent SDK - 7 Agents based on Shikigaku Theory with 100% cost reduction mode
89 lines • 2.45 kB
TypeScript
/**
* IssueAgent - Issue分析Agent
*
* 識学理論適用:
* - 責任: GitHubのIssueを解析し、適切なラベルと複雑度を判定
* - 権限: ラベル自動付与、複雑度推定、優先度判定
* - 階層: Specialist Layer
*
* Phase 8-1: Real API Integration
*/
import type { IssueData, AgentInput, AgentOutput } from "../types.js";
import { AnthropicClient } from "../clients/AnthropicClient.js";
import { ClaudeCodeClient } from "../clients/ClaudeCodeClient.js";
import { GitHubClient } from "../clients/GitHubClient.js";
export interface IssueInput extends AgentInput {
issueNumber: number;
repository: string;
owner: string;
useRealAPI?: boolean;
anthropicClient?: AnthropicClient;
claudeCodeClient?: ClaudeCodeClient;
githubClient?: GitHubClient;
}
export interface IssueOutput extends AgentOutput {
data?: IssueData & {
tokensUsed?: {
input: number;
output: number;
};
cost?: number;
};
}
/**
* IssueAgent実装
*
* GitHub Issue取得 → Claude分析 → ラベル付与 → 複雑度判定
*/
export declare class IssueAgent {
private anthropicClient?;
private claudeCodeClient?;
private githubClient?;
constructor(config?: {
anthropicApiKey?: string;
githubToken?: string;
useClaudeCode?: boolean;
});
/**
* メイン実行ロジック
*/
analyze(input: IssueInput): Promise<IssueOutput>;
/**
* GitHub IssueをAPI経由で取得
*
* Phase 8: Real GitHub API integration
*/
private fetchIssue;
/**
* Claude Sonnet 4で自然言語解析
*
* Phase 8: Real Claude API integration
* Phase 9: Claude Code CLI integration
*/
private analyzeWithClaude;
/**
* Claude分析用プロンプト生成
*/
private buildAnalysisPrompt;
/**
* キーワードベースの簡易分析
*
* Claude統合前のフォールバック実装
*/
private keywordBasedAnalysis;
/**
* Priority label取得
*/
private getPriorityLabel;
/**
* ラベル付与(GitHub API)
*
* Phase 8: Real GitHub API integration
*/
private applyLabels;
/**
* 工数推定(complexityから推定時間に変換)
*/
estimateEffort(complexity: "small" | "medium" | "large" | "xlarge"): string;
}
//# sourceMappingURL=IssueAgent.d.ts.map