@nahisaho/katashiro-orchestrator 0.4.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/README.md +152 -0
- package/dist/action-observation-types.d.ts +239 -0
- package/dist/action-observation-types.d.ts.map +1 -0
- package/dist/action-observation-types.js +22 -0
- package/dist/action-observation-types.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -0
- package/dist/index.js.map +1 -0
- package/dist/multi-agent-orchestrator.d.ts +147 -0
- package/dist/multi-agent-orchestrator.d.ts.map +1 -0
- package/dist/multi-agent-orchestrator.js +409 -0
- package/dist/multi-agent-orchestrator.js.map +1 -0
- package/dist/task-decomposer.d.ts +113 -0
- package/dist/task-decomposer.d.ts.map +1 -0
- package/dist/task-decomposer.js +530 -0
- package/dist/task-decomposer.js.map +1 -0
- package/dist/tool-registry.d.ts +153 -0
- package/dist/tool-registry.d.ts.map +1 -0
- package/dist/tool-registry.js +416 -0
- package/dist/tool-registry.js.map +1 -0
- package/dist/types.d.ts +272 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +32 -0
- package/dist/types.js.map +1 -0
- package/package.json +55 -0
package/README.md
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
# @nahisaho/katashiro-orchestrator
|
|
2
|
+
|
|
3
|
+
> Task decomposition, planning, and multi-agent orchestration for KATASHIRO
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Task Decomposition (REQ-009)**: Automatically decompose complex tasks into subtasks with DAG-based dependency management
|
|
8
|
+
- **Action-Observation Pattern (REQ-010)**: Type-safe tool system with risk assessment and approval workflow
|
|
9
|
+
- **Multi-Agent Orchestration (REQ-006)**: Spawn independent sub-agents with isolated contexts
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @nahisaho/katashiro-orchestrator
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Task Decomposition
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import { TaskDecomposer } from '@nahisaho/katashiro-orchestrator';
|
|
23
|
+
|
|
24
|
+
const decomposer = new TaskDecomposer({
|
|
25
|
+
maxSubTasks: 50,
|
|
26
|
+
allowParallel: true,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Decompose a complex task
|
|
30
|
+
const result = await decomposer.decompose('生成AIの企業活用について調べてレポートにまとめて');
|
|
31
|
+
|
|
32
|
+
if (result.ok) {
|
|
33
|
+
const plan = result.value;
|
|
34
|
+
console.log('Execution Plan:', plan.name);
|
|
35
|
+
console.log('Subtasks:', plan.tasks.length);
|
|
36
|
+
console.log('Parallel Groups:', plan.parallelGroups.length);
|
|
37
|
+
console.log('Estimated Duration:', plan.estimatedTotalDuration, 'seconds');
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Tool Registry
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { ToolRegistry, type ToolDefinition } from '@nahisaho/katashiro-orchestrator';
|
|
45
|
+
|
|
46
|
+
const registry = new ToolRegistry({
|
|
47
|
+
enableRiskAssessment: true,
|
|
48
|
+
approvalRequiredLevel: 'critical',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
// Register a tool
|
|
52
|
+
const searchTool: ToolDefinition<{ query: string }, { results: string[] }> = {
|
|
53
|
+
name: 'web_search',
|
|
54
|
+
description: 'Search the web for information',
|
|
55
|
+
category: 'network',
|
|
56
|
+
paramsSchema: {
|
|
57
|
+
type: 'object',
|
|
58
|
+
properties: {
|
|
59
|
+
query: { type: 'string' },
|
|
60
|
+
},
|
|
61
|
+
required: ['query'],
|
|
62
|
+
},
|
|
63
|
+
resultSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
results: { type: 'array', items: { type: 'string' } },
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
defaultRiskLevel: 'low',
|
|
70
|
+
defaultTimeout: 30,
|
|
71
|
+
execute: async (params, context) => {
|
|
72
|
+
context.logger.info('Searching for:', params.query);
|
|
73
|
+
// Implementation...
|
|
74
|
+
return { results: ['result1', 'result2'] };
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
registry.register(searchTool);
|
|
79
|
+
|
|
80
|
+
// Create and execute an action
|
|
81
|
+
const actionResult = registry.createAction({
|
|
82
|
+
toolName: 'web_search',
|
|
83
|
+
params: { query: 'KATASHIRO' },
|
|
84
|
+
requestedBy: 'agent-001',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
if (actionResult.ok) {
|
|
88
|
+
const observation = await registry.execute(actionResult.value);
|
|
89
|
+
console.log('Observation:', observation);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## API Reference
|
|
94
|
+
|
|
95
|
+
### TaskDecomposer
|
|
96
|
+
|
|
97
|
+
#### Constructor
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
new TaskDecomposer(config?: Partial<DecompositionConfig>)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
| Config Option | Type | Default | Description |
|
|
104
|
+
|--------------|------|---------|-------------|
|
|
105
|
+
| maxSubTasks | number | 50 | Maximum number of subtasks |
|
|
106
|
+
| minTaskGranularity | number | 5 | Minimum task duration (seconds) |
|
|
107
|
+
| maxDependencyDepth | number | 10 | Maximum dependency depth |
|
|
108
|
+
| allowParallel | boolean | true | Allow parallel execution |
|
|
109
|
+
|
|
110
|
+
#### Methods
|
|
111
|
+
|
|
112
|
+
- `decompose(task: string, context?: Record<string, unknown>): Promise<Result<ExecutionPlan, DecompositionError>>`
|
|
113
|
+
- `registerStrategy(strategy: DecompositionStrategy): void`
|
|
114
|
+
|
|
115
|
+
### ToolRegistry
|
|
116
|
+
|
|
117
|
+
#### Constructor
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
new ToolRegistry(config?: Partial<ToolRegistryConfig>)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
| Config Option | Type | Default | Description |
|
|
124
|
+
|--------------|------|---------|-------------|
|
|
125
|
+
| allowUnregistered | boolean | false | Allow unregistered tools |
|
|
126
|
+
| defaultTimeout | number | 30 | Default timeout (seconds) |
|
|
127
|
+
| enforceSchemaValidation | boolean | true | Enforce schema validation |
|
|
128
|
+
| enableRiskAssessment | boolean | true | Enable risk assessment |
|
|
129
|
+
| approvalRequiredLevel | RiskLevel | 'critical' | Risk level requiring approval |
|
|
130
|
+
|
|
131
|
+
#### Methods
|
|
132
|
+
|
|
133
|
+
- `register<TParams, TResult>(tool: ToolDefinition<TParams, TResult>): Result<void, ToolRegistryError>`
|
|
134
|
+
- `createAction<TParams>(options: CreateActionOptions<TParams>): Result<Action<TParams>, ToolRegistryError>`
|
|
135
|
+
- `execute<TParams, TResult>(action: Action<TParams>, signal?: AbortSignal): Promise<Result<Observation<TResult>, ToolRegistryError>>`
|
|
136
|
+
- `assessRisk(action: Action): SecurityAssessment`
|
|
137
|
+
|
|
138
|
+
## EARS Requirements Coverage
|
|
139
|
+
|
|
140
|
+
This package implements the following EARS requirements:
|
|
141
|
+
|
|
142
|
+
| Requirement | Pattern | Implementation |
|
|
143
|
+
|------------|---------|----------------|
|
|
144
|
+
| REQ-009 | Event-Driven | TaskDecomposer.decompose() |
|
|
145
|
+
| REQ-009 | Ubiquitous | ExecutionPlan DAG structure |
|
|
146
|
+
| REQ-010 | Event-Driven | ToolRegistry.execute() |
|
|
147
|
+
| REQ-010 | Unwanted | Risk assessment and approval |
|
|
148
|
+
| REQ-006 | State-Driven | AgentContext isolation |
|
|
149
|
+
|
|
150
|
+
## License
|
|
151
|
+
|
|
152
|
+
MIT
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action-Observation Tool System Types
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview REQ-010: Action-Observation型安全ツールシステム
|
|
5
|
+
* @module @nahisaho/katashiro-orchestrator
|
|
6
|
+
* @since 0.4.0
|
|
7
|
+
*/
|
|
8
|
+
import type { ID, Timestamp } from '@nahisaho/katashiro-core';
|
|
9
|
+
/**
|
|
10
|
+
* リスクレベル
|
|
11
|
+
* EARS: The system shall evaluate action risk level before execution
|
|
12
|
+
*/
|
|
13
|
+
export type RiskLevel = 'low' | 'medium' | 'high' | 'critical';
|
|
14
|
+
/**
|
|
15
|
+
* アクションカテゴリ
|
|
16
|
+
*/
|
|
17
|
+
export type ActionCategory = 'read' | 'write' | 'execute' | 'network' | 'system' | 'browser' | 'custom';
|
|
18
|
+
/**
|
|
19
|
+
* Action定義(型安全な入力)
|
|
20
|
+
* EARS: When a tool is invoked, the system shall validate input against Action schema
|
|
21
|
+
*/
|
|
22
|
+
export interface Action<TParams = Record<string, unknown>> {
|
|
23
|
+
/** アクションID */
|
|
24
|
+
readonly id: ID;
|
|
25
|
+
/** アクション名 */
|
|
26
|
+
readonly name: string;
|
|
27
|
+
/** ツール名 */
|
|
28
|
+
readonly toolName: string;
|
|
29
|
+
/** カテゴリ */
|
|
30
|
+
readonly category: ActionCategory;
|
|
31
|
+
/** パラメータ(型安全) */
|
|
32
|
+
readonly params: TParams;
|
|
33
|
+
/** パラメータスキーマ(JSON Schema) */
|
|
34
|
+
readonly paramsSchema: Record<string, unknown>;
|
|
35
|
+
/** リスクレベル */
|
|
36
|
+
readonly riskLevel: RiskLevel;
|
|
37
|
+
/** タイムアウト(秒) */
|
|
38
|
+
readonly timeout: number;
|
|
39
|
+
/** 作成日時 */
|
|
40
|
+
readonly createdAt: Timestamp;
|
|
41
|
+
/** リクエスト元エージェントID */
|
|
42
|
+
readonly requestedBy: ID;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Observation定義(型安全な出力)
|
|
46
|
+
* EARS: When a tool execution completes, the system shall return a typed Observation
|
|
47
|
+
*/
|
|
48
|
+
export interface Observation<TResult = unknown> {
|
|
49
|
+
/** ObservationID */
|
|
50
|
+
readonly id: ID;
|
|
51
|
+
/** 対応するActionID */
|
|
52
|
+
readonly actionId: ID;
|
|
53
|
+
/** ステータス */
|
|
54
|
+
readonly status: 'success' | 'error' | 'timeout' | 'cancelled';
|
|
55
|
+
/** 結果データ(型安全) */
|
|
56
|
+
readonly result?: TResult;
|
|
57
|
+
/** 結果スキーマ(JSON Schema) */
|
|
58
|
+
readonly resultSchema?: Record<string, unknown>;
|
|
59
|
+
/** エラー情報 */
|
|
60
|
+
readonly error?: ObservationError;
|
|
61
|
+
/** 実行時間(ミリ秒) */
|
|
62
|
+
readonly duration: number;
|
|
63
|
+
/** 完了日時 */
|
|
64
|
+
readonly completedAt: Timestamp;
|
|
65
|
+
/** メタデータ */
|
|
66
|
+
readonly metadata?: ObservationMetadata;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Observationエラー
|
|
70
|
+
*/
|
|
71
|
+
export interface ObservationError {
|
|
72
|
+
/** エラーコード */
|
|
73
|
+
readonly code: string;
|
|
74
|
+
/** エラーメッセージ */
|
|
75
|
+
readonly message: string;
|
|
76
|
+
/** スタックトレース(デバッグ用) */
|
|
77
|
+
readonly stack?: string;
|
|
78
|
+
/** リトライ可能か */
|
|
79
|
+
readonly retryable: boolean;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Observationメタデータ
|
|
83
|
+
*/
|
|
84
|
+
export interface ObservationMetadata {
|
|
85
|
+
/** リソース使用量 */
|
|
86
|
+
readonly resourceUsage?: ResourceUsage;
|
|
87
|
+
/** ログ出力 */
|
|
88
|
+
readonly logs?: string[];
|
|
89
|
+
/** 警告 */
|
|
90
|
+
readonly warnings?: string[];
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* リソース使用量
|
|
94
|
+
*/
|
|
95
|
+
export interface ResourceUsage {
|
|
96
|
+
/** CPU時間(ミリ秒) */
|
|
97
|
+
readonly cpuTime?: number;
|
|
98
|
+
/** メモリ使用量(バイト) */
|
|
99
|
+
readonly memoryUsed?: number;
|
|
100
|
+
/** ネットワーク送信量(バイト) */
|
|
101
|
+
readonly networkSent?: number;
|
|
102
|
+
/** ネットワーク受信量(バイト) */
|
|
103
|
+
readonly networkReceived?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* ツール定義
|
|
107
|
+
* EARS: The system shall support tool registration with schema validation
|
|
108
|
+
*/
|
|
109
|
+
export interface ToolDefinition<TParams = Record<string, unknown>, TResult = unknown> {
|
|
110
|
+
/** ツール名(一意) */
|
|
111
|
+
readonly name: string;
|
|
112
|
+
/** ツール説明 */
|
|
113
|
+
readonly description: string;
|
|
114
|
+
/** カテゴリ */
|
|
115
|
+
readonly category: ActionCategory;
|
|
116
|
+
/** パラメータスキーマ(JSON Schema) */
|
|
117
|
+
readonly paramsSchema: Record<string, unknown>;
|
|
118
|
+
/** 結果スキーマ(JSON Schema) */
|
|
119
|
+
readonly resultSchema: Record<string, unknown>;
|
|
120
|
+
/** デフォルトリスクレベル */
|
|
121
|
+
readonly defaultRiskLevel: RiskLevel;
|
|
122
|
+
/** デフォルトタイムアウト(秒) */
|
|
123
|
+
readonly defaultTimeout: number;
|
|
124
|
+
/** ツール実行関数 */
|
|
125
|
+
readonly execute: ToolExecutor<TParams, TResult>;
|
|
126
|
+
/** 許可されるロール */
|
|
127
|
+
readonly allowedRoles?: readonly string[];
|
|
128
|
+
/** 必要な権限 */
|
|
129
|
+
readonly requiredPermissions?: readonly string[];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* ツール実行関数
|
|
133
|
+
*/
|
|
134
|
+
export type ToolExecutor<TParams, TResult> = (params: TParams, context: ToolExecutionContext) => Promise<TResult>;
|
|
135
|
+
/**
|
|
136
|
+
* ツール実行コンテキスト
|
|
137
|
+
*/
|
|
138
|
+
export interface ToolExecutionContext {
|
|
139
|
+
/** 実行エージェントID */
|
|
140
|
+
readonly agentId: ID;
|
|
141
|
+
/** アクションID */
|
|
142
|
+
readonly actionId: ID;
|
|
143
|
+
/** タイムアウト(秒) */
|
|
144
|
+
readonly timeout: number;
|
|
145
|
+
/** キャンセルシグナル */
|
|
146
|
+
readonly signal: AbortSignal;
|
|
147
|
+
/** ロガー */
|
|
148
|
+
readonly logger: ToolLogger;
|
|
149
|
+
/** サンドボックス環境か */
|
|
150
|
+
readonly isSandboxed: boolean;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* ツールロガー
|
|
154
|
+
*/
|
|
155
|
+
export interface ToolLogger {
|
|
156
|
+
debug(message: string, ...args: unknown[]): void;
|
|
157
|
+
info(message: string, ...args: unknown[]): void;
|
|
158
|
+
warn(message: string, ...args: unknown[]): void;
|
|
159
|
+
error(message: string, ...args: unknown[]): void;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* セキュリティ評価結果
|
|
163
|
+
* EARS: If action risk level is 'critical', the system shall require explicit approval
|
|
164
|
+
*/
|
|
165
|
+
export interface SecurityAssessment {
|
|
166
|
+
/** 評価ID */
|
|
167
|
+
readonly id: ID;
|
|
168
|
+
/** 対象ActionID */
|
|
169
|
+
readonly actionId: ID;
|
|
170
|
+
/** 最終リスクレベル */
|
|
171
|
+
readonly riskLevel: RiskLevel;
|
|
172
|
+
/** リスク要因 */
|
|
173
|
+
readonly riskFactors: readonly RiskFactor[];
|
|
174
|
+
/** 承認必要か */
|
|
175
|
+
readonly requiresApproval: boolean;
|
|
176
|
+
/** 推奨事項 */
|
|
177
|
+
readonly recommendations: readonly string[];
|
|
178
|
+
/** 評価日時 */
|
|
179
|
+
readonly assessedAt: Timestamp;
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* リスク要因
|
|
183
|
+
*/
|
|
184
|
+
export interface RiskFactor {
|
|
185
|
+
/** 要因名 */
|
|
186
|
+
readonly name: string;
|
|
187
|
+
/** 説明 */
|
|
188
|
+
readonly description: string;
|
|
189
|
+
/** 重大度(0-1) */
|
|
190
|
+
readonly severity: number;
|
|
191
|
+
/** 対策 */
|
|
192
|
+
readonly mitigation?: string;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* 承認リクエスト
|
|
196
|
+
* EARS: When approval is required, the system shall pause and request user confirmation
|
|
197
|
+
*/
|
|
198
|
+
export interface ApprovalRequest {
|
|
199
|
+
/** リクエストID */
|
|
200
|
+
readonly id: ID;
|
|
201
|
+
/** 対象ActionID */
|
|
202
|
+
readonly actionId: ID;
|
|
203
|
+
/** セキュリティ評価 */
|
|
204
|
+
readonly assessment: SecurityAssessment;
|
|
205
|
+
/** リクエスト理由 */
|
|
206
|
+
readonly reason: string;
|
|
207
|
+
/** リクエスト日時 */
|
|
208
|
+
readonly requestedAt: Timestamp;
|
|
209
|
+
/** 有効期限 */
|
|
210
|
+
readonly expiresAt: Timestamp;
|
|
211
|
+
/** 状態 */
|
|
212
|
+
status: 'pending' | 'approved' | 'rejected' | 'expired';
|
|
213
|
+
/** 承認/却下日時 */
|
|
214
|
+
resolvedAt?: Timestamp;
|
|
215
|
+
/** 承認/却下者 */
|
|
216
|
+
resolvedBy?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* ツールレジストリ設定
|
|
220
|
+
*/
|
|
221
|
+
export interface ToolRegistryConfig {
|
|
222
|
+
/** 未登録ツールの実行を許可 */
|
|
223
|
+
readonly allowUnregistered: boolean;
|
|
224
|
+
/** デフォルトタイムアウト(秒) */
|
|
225
|
+
readonly defaultTimeout: number;
|
|
226
|
+
/** スキーマバリデーションを強制 */
|
|
227
|
+
readonly enforceSchemaValidation: boolean;
|
|
228
|
+
/** リスク評価を有効化 */
|
|
229
|
+
readonly enableRiskAssessment: boolean;
|
|
230
|
+
/** 承認が必要なリスクレベル */
|
|
231
|
+
readonly approvalRequiredLevel: RiskLevel;
|
|
232
|
+
/** 承認タイムアウト(秒) */
|
|
233
|
+
readonly approvalTimeout: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* デフォルトツールレジストリ設定
|
|
237
|
+
*/
|
|
238
|
+
export declare const DEFAULT_TOOL_REGISTRY_CONFIG: ToolRegistryConfig;
|
|
239
|
+
//# sourceMappingURL=action-observation-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-observation-types.d.ts","sourceRoot":"","sources":["../src/action-observation-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAM9D;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,UAAU,CAAC;AAE/D;;GAEG;AACH,MAAM,MAAM,cAAc,GACtB,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,QAAQ,CAAC;AAEb;;;GAGG;AACH,MAAM,WAAW,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACvD,cAAc;IACd,QAAQ,CAAC,EAAE,EAAE,EAAE,CAAC;IAChB,aAAa;IACb,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,WAAW;IACX,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,WAAW;IACX,QAAQ,CAAC,QAAQ,EAAE,cAAc,CAAC;IAClC,iBAAiB;IACjB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,6BAA6B;IAC7B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/C,aAAa;IACb,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,gBAAgB;IAChB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,WAAW;IACX,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,qBAAqB;IACrB,QAAQ,CAAC,WA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CAAC,eAAe,EAAE,MAAM,CAAC;CAClC;AAED;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,kBAO1C,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Action-Observation Tool System Types
|
|
4
|
+
*
|
|
5
|
+
* @fileoverview REQ-010: Action-Observation型安全ツールシステム
|
|
6
|
+
* @module @nahisaho/katashiro-orchestrator
|
|
7
|
+
* @since 0.4.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.DEFAULT_TOOL_REGISTRY_CONFIG = void 0;
|
|
11
|
+
/**
|
|
12
|
+
* デフォルトツールレジストリ設定
|
|
13
|
+
*/
|
|
14
|
+
exports.DEFAULT_TOOL_REGISTRY_CONFIG = {
|
|
15
|
+
allowUnregistered: false,
|
|
16
|
+
defaultTimeout: 30,
|
|
17
|
+
enforceSchemaValidation: true,
|
|
18
|
+
enableRiskAssessment: true,
|
|
19
|
+
approvalRequiredLevel: 'critical',
|
|
20
|
+
approvalTimeout: 30, // 30秒タイムアウト
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=action-observation-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-observation-types.js","sourceRoot":"","sources":["../src/action-observation-types.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA+QH;;GAEG;AACU,QAAA,4BAA4B,GAAuB;IAC9D,iBAAiB,EAAE,KAAK;IACxB,cAAc,EAAE,EAAE;IAClB,uBAAuB,EAAE,IAAI;IAC7B,oBAAoB,EAAE,IAAI;IAC1B,qBAAqB,EAAE,UAAU;IACjC,eAAe,EAAE,EAAE,EAAE,YAAY;CAClC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KATASHIRO Orchestrator Package
|
|
3
|
+
*
|
|
4
|
+
* @fileoverview REQ-006, REQ-009, REQ-010の実装エントリーポイント
|
|
5
|
+
* @module @nahisaho/katashiro-orchestrator
|
|
6
|
+
* @since 0.4.0
|
|
7
|
+
*/
|
|
8
|
+
export type { TaskPriority, TaskStatus, SubTask, TaskInput, TaskResult, TaskError, ExecutionPlan, DecompositionConfig, AgentRole, AgentState, SubAgent, AgentContext, ConversationMessage, ToolCallInfo, OrchestrationConfig, OrchestrationResult, OrchestratorEventType, OrchestratorEvent, OrchestratorEventListener, } from './types';
|
|
9
|
+
export type { RiskLevel, ActionCategory, Action, Observation, ObservationError, ObservationMetadata, ResourceUsage, ToolDefinition, ToolExecutor, ToolExecutionContext, ToolLogger, SecurityAssessment, RiskFactor, ApprovalRequest, ToolRegistryConfig, } from './action-observation-types';
|
|
10
|
+
export { DEFAULT_DECOMPOSITION_CONFIG, DEFAULT_ORCHESTRATION_CONFIG, } from './types';
|
|
11
|
+
export { DEFAULT_TOOL_REGISTRY_CONFIG } from './action-observation-types';
|
|
12
|
+
export { TaskDecomposer, DecompositionError, type DecompositionStrategy, type DecomposedTask, } from './task-decomposer';
|
|
13
|
+
export { ToolRegistry, ToolRegistryError, type CreateActionOptions, type ApprovalRequestEvent, type ApprovalResolvedEvent, type ToolRegistryEvents, } from './tool-registry';
|
|
14
|
+
export { MultiAgentOrchestrator, type MultiAgentOrchestratorOptions, type ResultAggregatorConfig, type AggregatedResult, } from './multi-agent-orchestrator';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EAEV,YAAY,EACZ,UAAU,EACV,OAAO,EACP,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,mBAAmB,EAEnB,SAAS,EACT,UAAU,EACV,QAAQ,EACR,YAAY,EACZ,mBAAmB,EACnB,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,iBAAiB,EACjB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAEjB,YAAY,EAEV,SAAS,EACT,cAAc,EACd,MAAM,EACN,WAAW,EACX,gBAAgB,EAChB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,oBAAoB,EACpB,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,eAAe,EACf,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAG1E,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,KAAK,qBAAqB,EAC1B,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,kBAAkB,GACxB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,sBAAsB,EACtB,KAAK,6BAA6B,EAClC,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,GACtB,MAAM,4BAA4B,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* KATASHIRO Orchestrator Package
|
|
4
|
+
*
|
|
5
|
+
* @fileoverview REQ-006, REQ-009, REQ-010の実装エントリーポイント
|
|
6
|
+
* @module @nahisaho/katashiro-orchestrator
|
|
7
|
+
* @since 0.4.0
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.MultiAgentOrchestrator = exports.ToolRegistryError = exports.ToolRegistry = exports.DecompositionError = exports.TaskDecomposer = exports.DEFAULT_TOOL_REGISTRY_CONFIG = exports.DEFAULT_ORCHESTRATION_CONFIG = exports.DEFAULT_DECOMPOSITION_CONFIG = void 0;
|
|
11
|
+
// 定数
|
|
12
|
+
var types_1 = require("./types");
|
|
13
|
+
Object.defineProperty(exports, "DEFAULT_DECOMPOSITION_CONFIG", { enumerable: true, get: function () { return types_1.DEFAULT_DECOMPOSITION_CONFIG; } });
|
|
14
|
+
Object.defineProperty(exports, "DEFAULT_ORCHESTRATION_CONFIG", { enumerable: true, get: function () { return types_1.DEFAULT_ORCHESTRATION_CONFIG; } });
|
|
15
|
+
var action_observation_types_1 = require("./action-observation-types");
|
|
16
|
+
Object.defineProperty(exports, "DEFAULT_TOOL_REGISTRY_CONFIG", { enumerable: true, get: function () { return action_observation_types_1.DEFAULT_TOOL_REGISTRY_CONFIG; } });
|
|
17
|
+
// クラス
|
|
18
|
+
var task_decomposer_1 = require("./task-decomposer");
|
|
19
|
+
Object.defineProperty(exports, "TaskDecomposer", { enumerable: true, get: function () { return task_decomposer_1.TaskDecomposer; } });
|
|
20
|
+
Object.defineProperty(exports, "DecompositionError", { enumerable: true, get: function () { return task_decomposer_1.DecompositionError; } });
|
|
21
|
+
var tool_registry_1 = require("./tool-registry");
|
|
22
|
+
Object.defineProperty(exports, "ToolRegistry", { enumerable: true, get: function () { return tool_registry_1.ToolRegistry; } });
|
|
23
|
+
Object.defineProperty(exports, "ToolRegistryError", { enumerable: true, get: function () { return tool_registry_1.ToolRegistryError; } });
|
|
24
|
+
// REQ-006: マルチエージェントオーケストレーター
|
|
25
|
+
var multi_agent_orchestrator_1 = require("./multi-agent-orchestrator");
|
|
26
|
+
Object.defineProperty(exports, "MultiAgentOrchestrator", { enumerable: true, get: function () { return multi_agent_orchestrator_1.MultiAgentOrchestrator; } });
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AA8CH,KAAK;AACL,iCAGiB;AAFf,qHAAA,4BAA4B,OAAA;AAC5B,qHAAA,4BAA4B,OAAA;AAG9B,uEAA0E;AAAjE,wIAAA,4BAA4B,OAAA;AAErC,MAAM;AACN,qDAK2B;AAJzB,iHAAA,cAAc,OAAA;AACd,qHAAA,kBAAkB,OAAA;AAKpB,iDAOyB;AANvB,6GAAA,YAAY,OAAA;AACZ,kHAAA,iBAAiB,OAAA;AAOnB,8BAA8B;AAC9B,uEAKoC;AAJlC,kIAAA,sBAAsB,OAAA"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MultiAgentOrchestrator - マルチエージェント並列実行オーケストレーター
|
|
3
|
+
*
|
|
4
|
+
* @requirement REQ-006
|
|
5
|
+
* @design REQ-006-01 複雑タスクを独立サブタスクに分解
|
|
6
|
+
* @design REQ-006-02 1秒以内にサブエージェント生成
|
|
7
|
+
* @design REQ-006-03 1-100の並列実行管理
|
|
8
|
+
* @design REQ-006-04 コンテキスト汚染防止
|
|
9
|
+
* @design REQ-006-05 結果集約・重複除去
|
|
10
|
+
* @design REQ-006-06 部分失敗でも継続
|
|
11
|
+
*/
|
|
12
|
+
import { TaskDecomposer } from './task-decomposer';
|
|
13
|
+
import { SubTask, SubAgent, TaskResult, TaskError, OrchestrationConfig, OrchestratorEventListener, OrchestratorEventType } from './types';
|
|
14
|
+
/**
|
|
15
|
+
* 結果集約設定
|
|
16
|
+
*/
|
|
17
|
+
export interface ResultAggregatorConfig {
|
|
18
|
+
/** 重複除去を有効化 */
|
|
19
|
+
deduplication: boolean;
|
|
20
|
+
/** 重複判定の類似度閾値(0-1) */
|
|
21
|
+
similarityThreshold: number;
|
|
22
|
+
/** 結果のソート順 */
|
|
23
|
+
sortBy: 'priority' | 'completion_time' | 'relevance';
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 集約結果
|
|
27
|
+
*/
|
|
28
|
+
export interface AggregatedResult {
|
|
29
|
+
/** 成功/失敗 */
|
|
30
|
+
success: boolean;
|
|
31
|
+
/** 集約された出力 */
|
|
32
|
+
output: unknown;
|
|
33
|
+
/** 元の結果数 */
|
|
34
|
+
originalCount: number;
|
|
35
|
+
/** 重複除去後の結果数 */
|
|
36
|
+
dedupedCount: number;
|
|
37
|
+
/** 失敗したサブタスク */
|
|
38
|
+
failures: Array<{
|
|
39
|
+
taskId: string;
|
|
40
|
+
error: TaskError;
|
|
41
|
+
}>;
|
|
42
|
+
/** メタデータ */
|
|
43
|
+
metadata: {
|
|
44
|
+
totalDuration: number;
|
|
45
|
+
agentsUsed: number;
|
|
46
|
+
deduplicationApplied: boolean;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* MultiAgentOrchestratorオプション
|
|
51
|
+
*/
|
|
52
|
+
export interface MultiAgentOrchestratorOptions {
|
|
53
|
+
/** オーケストレーション設定 */
|
|
54
|
+
config?: Partial<OrchestrationConfig>;
|
|
55
|
+
/** タスク分解器 */
|
|
56
|
+
taskDecomposer?: TaskDecomposer;
|
|
57
|
+
/** 結果集約設定 */
|
|
58
|
+
aggregatorConfig?: Partial<ResultAggregatorConfig>;
|
|
59
|
+
/** サブタスク実行関数 */
|
|
60
|
+
taskExecutor?: (task: SubTask, agent: SubAgent) => Promise<TaskResult>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* マルチエージェントオーケストレーター
|
|
64
|
+
*/
|
|
65
|
+
export declare class MultiAgentOrchestrator {
|
|
66
|
+
private readonly config;
|
|
67
|
+
private readonly taskDecomposer;
|
|
68
|
+
private readonly aggregatorConfig;
|
|
69
|
+
private readonly taskExecutor;
|
|
70
|
+
private readonly agents;
|
|
71
|
+
private readonly listeners;
|
|
72
|
+
private runningAgents;
|
|
73
|
+
constructor(options?: MultiAgentOrchestratorOptions);
|
|
74
|
+
/**
|
|
75
|
+
* タスクを実行(REQ-006-01)
|
|
76
|
+
*/
|
|
77
|
+
execute(taskDescription: string): Promise<AggregatedResult>;
|
|
78
|
+
/**
|
|
79
|
+
* サブエージェントを生成(REQ-006-02)
|
|
80
|
+
*/
|
|
81
|
+
spawnSubAgents(tasks: SubTask[]): Promise<SubAgent[]>;
|
|
82
|
+
/**
|
|
83
|
+
* タスクを並列実行(REQ-006-03, REQ-006-04, REQ-006-06)
|
|
84
|
+
*/
|
|
85
|
+
private executeParallel;
|
|
86
|
+
/**
|
|
87
|
+
* 単一タスクを実行
|
|
88
|
+
*/
|
|
89
|
+
private executeTask;
|
|
90
|
+
/**
|
|
91
|
+
* 結果を集約(REQ-006-05)
|
|
92
|
+
*/
|
|
93
|
+
aggregate(results: Map<string, TaskResult>): Promise<Omit<AggregatedResult, 'metadata'>>;
|
|
94
|
+
/**
|
|
95
|
+
* 結果の重複を除去
|
|
96
|
+
*/
|
|
97
|
+
private deduplicateResults;
|
|
98
|
+
/**
|
|
99
|
+
* 結果をソート
|
|
100
|
+
*/
|
|
101
|
+
private sortResults;
|
|
102
|
+
/**
|
|
103
|
+
* 結果のハッシュを生成
|
|
104
|
+
*/
|
|
105
|
+
private hashResult;
|
|
106
|
+
/**
|
|
107
|
+
* エージェントを作成(REQ-006-04: 独立コンテキスト)
|
|
108
|
+
*/
|
|
109
|
+
private createAgent;
|
|
110
|
+
/**
|
|
111
|
+
* タスクからエージェントロールを決定
|
|
112
|
+
*/
|
|
113
|
+
private determineAgentRole;
|
|
114
|
+
/**
|
|
115
|
+
* デフォルトのタスク実行関数
|
|
116
|
+
*/
|
|
117
|
+
private defaultTaskExecutor;
|
|
118
|
+
/**
|
|
119
|
+
* タイムアウト付きPromise
|
|
120
|
+
*/
|
|
121
|
+
private withTimeout;
|
|
122
|
+
/**
|
|
123
|
+
* 全エージェントを終了
|
|
124
|
+
*/
|
|
125
|
+
private terminateAllAgents;
|
|
126
|
+
/**
|
|
127
|
+
* イベントリスナーを登録
|
|
128
|
+
*/
|
|
129
|
+
on(event: OrchestratorEventType, listener: OrchestratorEventListener): void;
|
|
130
|
+
/**
|
|
131
|
+
* イベントを発行
|
|
132
|
+
*/
|
|
133
|
+
private emit;
|
|
134
|
+
/**
|
|
135
|
+
* 設定を取得
|
|
136
|
+
*/
|
|
137
|
+
getConfig(): OrchestrationConfig;
|
|
138
|
+
/**
|
|
139
|
+
* 現在のエージェント数を取得
|
|
140
|
+
*/
|
|
141
|
+
getRunningAgentCount(): number;
|
|
142
|
+
/**
|
|
143
|
+
* 全エージェントを取得
|
|
144
|
+
*/
|
|
145
|
+
getAgents(): SubAgent[];
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=multi-agent-orchestrator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multi-agent-orchestrator.d.ts","sourceRoot":"","sources":["../src/multi-agent-orchestrator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,OAAO,EACP,QAAQ,EAGR,UAAU,EACV,SAAS,EACT,mBAAmB,EAEnB,yBAAyB,EACzB,qBAAqB,EAEtB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,eAAe;IACf,aAAa,EAAE,OAAO,CAAC;IACvB,sBAAsB;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc;IACd,MAAM,EAAE,UAAU,GAAG,iBAAiB,GAAG,WAAW,CAAC;CACtD;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,YAAY;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY;IACZ,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB;IAChB,QAAQ,EAAE,KAAK,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACtD,YAAY;IACZ,QAAQ,EAA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