gthinking 1.1.0 → 1.2.1
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/GEMINI.md +68 -0
- package/README.md +39 -1
- package/analysis.ts +78 -1
- package/creativity.ts +62 -9
- package/dist/analysis.d.ts +2 -0
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +75 -1
- package/dist/analysis.js.map +1 -1
- package/dist/creativity.d.ts +2 -1
- package/dist/creativity.d.ts.map +1 -1
- package/dist/creativity.js +57 -7
- package/dist/creativity.js.map +1 -1
- package/dist/engine.d.ts +15 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +23 -21
- package/dist/engine.js.map +1 -1
- package/dist/examples.js +1 -1
- package/dist/examples.js.map +1 -1
- package/dist/llm-service.d.ts +21 -0
- package/dist/llm-service.d.ts.map +1 -0
- package/dist/llm-service.js +100 -0
- package/dist/llm-service.js.map +1 -0
- package/dist/reasoning.d.ts +1 -0
- package/dist/reasoning.d.ts.map +1 -1
- package/dist/reasoning.js +80 -27
- package/dist/reasoning.js.map +1 -1
- package/dist/search-discovery.d.ts.map +1 -1
- package/dist/search-discovery.js +43 -0
- package/dist/search-discovery.js.map +1 -1
- package/dist/types/analysis.d.ts +54 -0
- package/dist/types/analysis.d.ts.map +1 -0
- package/dist/types/analysis.js +3 -0
- package/dist/types/analysis.js.map +1 -0
- package/dist/types/core.d.ts +66 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +61 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/creativity.d.ts +58 -0
- package/dist/types/creativity.d.ts.map +1 -0
- package/dist/types/creativity.js +3 -0
- package/dist/types/creativity.js.map +1 -0
- package/dist/types/engine.d.ts +55 -0
- package/dist/types/engine.d.ts.map +1 -0
- package/dist/types/engine.js +3 -0
- package/dist/types/engine.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +26 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/learning.d.ts +62 -0
- package/dist/types/learning.d.ts.map +1 -0
- package/dist/types/learning.js +3 -0
- package/dist/types/learning.js.map +1 -0
- package/dist/types/planning.d.ts +78 -0
- package/dist/types/planning.d.ts.map +1 -0
- package/dist/types/planning.js +3 -0
- package/dist/types/planning.js.map +1 -0
- package/dist/types/reasoning.d.ts +83 -0
- package/dist/types/reasoning.d.ts.map +1 -0
- package/dist/types/reasoning.js +13 -0
- package/dist/types/reasoning.js.map +1 -0
- package/dist/types/search.d.ts +56 -0
- package/dist/types/search.d.ts.map +1 -0
- package/dist/types/search.js +3 -0
- package/dist/types/search.js.map +1 -0
- package/dist/types/synthesis.d.ts +39 -0
- package/dist/types/synthesis.d.ts.map +1 -0
- package/dist/types/synthesis.js +3 -0
- package/dist/types/synthesis.js.map +1 -0
- package/dist/types.d.ts +1 -530
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +15 -70
- package/dist/types.js.map +1 -1
- package/engine.ts +42 -23
- package/examples.ts +1 -1
- package/llm-service.ts +120 -0
- package/package.json +1 -1
- package/reasoning.ts +88 -28
- package/search-discovery.ts +46 -0
- package/types/analysis.ts +69 -0
- package/types/core.ts +90 -0
- package/types/creativity.ts +72 -0
- package/types/engine.ts +60 -0
- package/types/index.ts +9 -0
- package/types/learning.ts +69 -0
- package/types/planning.ts +85 -0
- package/types/reasoning.ts +92 -0
- package/types/search.ts +58 -0
- package/types/synthesis.ts +42 -0
- package/types.ts +1 -669
package/types/core.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core Types and Enums
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
export enum ThinkingStage {
|
|
6
|
+
SEARCH = 'search',
|
|
7
|
+
ANALYSIS = 'analysis',
|
|
8
|
+
REASONING = 'reasoning',
|
|
9
|
+
LEARNING = 'learning',
|
|
10
|
+
PLANNING = 'planning',
|
|
11
|
+
CREATIVITY = 'creativity',
|
|
12
|
+
SYNTHESIS = 'synthesis',
|
|
13
|
+
EVALUATION = 'evaluation'
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export enum ConfidenceLevel {
|
|
17
|
+
VERY_LOW = 0.1,
|
|
18
|
+
LOW = 0.3,
|
|
19
|
+
MEDIUM = 0.5,
|
|
20
|
+
HIGH = 0.7,
|
|
21
|
+
VERY_HIGH = 0.9
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export enum Priority {
|
|
25
|
+
CRITICAL = 1,
|
|
26
|
+
HIGH = 2,
|
|
27
|
+
MEDIUM = 3,
|
|
28
|
+
LOW = 4,
|
|
29
|
+
MINIMAL = 5
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export enum TaskStatus {
|
|
33
|
+
PENDING = 'pending',
|
|
34
|
+
IN_PROGRESS = 'in_progress',
|
|
35
|
+
COMPLETED = 'completed',
|
|
36
|
+
FAILED = 'failed',
|
|
37
|
+
CANCELLED = 'cancelled'
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export enum SourceType {
|
|
41
|
+
WEB = 'web',
|
|
42
|
+
DATABASE = 'database',
|
|
43
|
+
API = 'api',
|
|
44
|
+
CACHE = 'cache',
|
|
45
|
+
KNOWLEDGE_BASE = 'knowledge_base',
|
|
46
|
+
USER_INPUT = 'user_input'
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type ThinkingEventType =
|
|
50
|
+
| 'stage_start'
|
|
51
|
+
| 'stage_complete'
|
|
52
|
+
| 'stage_error'
|
|
53
|
+
| 'insight_found'
|
|
54
|
+
| 'confidence_update'
|
|
55
|
+
| 'search_result'
|
|
56
|
+
| 'analysis_complete'
|
|
57
|
+
| 'reasoning_step'
|
|
58
|
+
| 'plan_created'
|
|
59
|
+
| 'idea_generated';
|
|
60
|
+
|
|
61
|
+
export interface ThinkingEvent {
|
|
62
|
+
id: string;
|
|
63
|
+
type: ThinkingEventType;
|
|
64
|
+
stage: ThinkingStage;
|
|
65
|
+
timestamp: Date;
|
|
66
|
+
data: unknown;
|
|
67
|
+
sessionId: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface EventHandler {
|
|
71
|
+
(event: ThinkingEvent): void | Promise<void>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export class ThinkingError extends Error {
|
|
75
|
+
constructor(
|
|
76
|
+
message: string,
|
|
77
|
+
public stage: ThinkingStage,
|
|
78
|
+
public recoverable: boolean,
|
|
79
|
+
public originalError?: Error
|
|
80
|
+
) {
|
|
81
|
+
super(message);
|
|
82
|
+
this.name = 'ThinkingError';
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface ErrorRecoveryStrategy {
|
|
87
|
+
stage: ThinkingStage;
|
|
88
|
+
condition: (error: ThinkingError) => boolean;
|
|
89
|
+
action: (error: ThinkingError, context: unknown) => Promise<unknown>;
|
|
90
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
export interface CreativeSession {
|
|
2
|
+
id: string;
|
|
3
|
+
prompt: string;
|
|
4
|
+
techniques: CreativityTechnique[];
|
|
5
|
+
ideas: Idea[];
|
|
6
|
+
connections: Connection[];
|
|
7
|
+
sessionDuration: number;
|
|
8
|
+
divergentPhase: DivergentPhase;
|
|
9
|
+
convergentPhase: ConvergentPhase;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type CreativityTechnique =
|
|
13
|
+
| 'brainstorming'
|
|
14
|
+
| 'mind_mapping'
|
|
15
|
+
| 'scamper'
|
|
16
|
+
| 'six_thinking_hats'
|
|
17
|
+
| 'lateral_thinking'
|
|
18
|
+
| 'analogy'
|
|
19
|
+
| 'reverse_thinking'
|
|
20
|
+
| 'random_stimulus';
|
|
21
|
+
|
|
22
|
+
export interface Idea {
|
|
23
|
+
id: string;
|
|
24
|
+
content: string;
|
|
25
|
+
technique: CreativityTechnique;
|
|
26
|
+
novelty: number;
|
|
27
|
+
feasibility: number;
|
|
28
|
+
impact: number;
|
|
29
|
+
relatedIdeas: string[];
|
|
30
|
+
tags: string[];
|
|
31
|
+
generatedAt: Date;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface Connection {
|
|
35
|
+
id: string;
|
|
36
|
+
from: string;
|
|
37
|
+
to: string;
|
|
38
|
+
connectionType: 'similarity' | 'contrast' | 'cause_effect' | 'analogy' | 'combination';
|
|
39
|
+
strength: number;
|
|
40
|
+
insight: string;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface DivergentPhase {
|
|
44
|
+
startTime: Date;
|
|
45
|
+
endTime: Date;
|
|
46
|
+
ideaCount: number;
|
|
47
|
+
explorationBreadth: number;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface ConvergentPhase {
|
|
51
|
+
startTime: Date;
|
|
52
|
+
endTime: Date;
|
|
53
|
+
selectedIdeas: string[];
|
|
54
|
+
synthesis: string;
|
|
55
|
+
actionItems: string[];
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface OutOfBoxThinking {
|
|
59
|
+
id: string;
|
|
60
|
+
originalProblem: string;
|
|
61
|
+
reframedProblems: ReframedProblem[];
|
|
62
|
+
unconventionalApproaches: string[];
|
|
63
|
+
breakthroughPotential: number;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface ReframedProblem {
|
|
67
|
+
id: string;
|
|
68
|
+
perspective: string;
|
|
69
|
+
reframedStatement: string;
|
|
70
|
+
assumptionsChallenged: string[];
|
|
71
|
+
newPossibilities: string[];
|
|
72
|
+
}
|
package/types/engine.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ThinkingStage, TaskStatus } from './core';
|
|
2
|
+
import { LearningContext } from './learning';
|
|
3
|
+
|
|
4
|
+
export interface SequentialThinkingConfig {
|
|
5
|
+
maxSearchResults: number;
|
|
6
|
+
analysisDepth: 'surface' | 'moderate' | 'deep';
|
|
7
|
+
reasoningComplexity: 'simple' | 'moderate' | 'complex';
|
|
8
|
+
learningEnabled: boolean;
|
|
9
|
+
creativityLevel: 'conservative' | 'balanced' | 'adventurous';
|
|
10
|
+
planningDetail: 'high_level' | 'detailed' | 'granular';
|
|
11
|
+
timeout: number;
|
|
12
|
+
retryAttempts: number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface ThinkingRequest {
|
|
16
|
+
id: string;
|
|
17
|
+
query: string;
|
|
18
|
+
context?: string;
|
|
19
|
+
preferredStages?: ThinkingStage[];
|
|
20
|
+
config?: Partial<SequentialThinkingConfig>;
|
|
21
|
+
timeout?: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ThinkingResponse {
|
|
25
|
+
id: string;
|
|
26
|
+
requestId: string;
|
|
27
|
+
stages: StageResult[];
|
|
28
|
+
finalAnswer: string;
|
|
29
|
+
confidence: number;
|
|
30
|
+
processingTime: number;
|
|
31
|
+
metadata: ResponseMetadata;
|
|
32
|
+
timestamp: Date;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface StageResult {
|
|
36
|
+
stage: ThinkingStage;
|
|
37
|
+
status: TaskStatus;
|
|
38
|
+
input: unknown;
|
|
39
|
+
output: unknown;
|
|
40
|
+
processingTime: number;
|
|
41
|
+
confidence: number;
|
|
42
|
+
subResults?: unknown[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ResponseMetadata {
|
|
46
|
+
sourcesUsed: number;
|
|
47
|
+
reasoningSteps: number;
|
|
48
|
+
ideasGenerated: number;
|
|
49
|
+
tasksCreated: number;
|
|
50
|
+
knowledgeNodesAccessed: number;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ThinkingSession {
|
|
54
|
+
id: string;
|
|
55
|
+
requests: ThinkingRequest[];
|
|
56
|
+
responses: ThinkingResponse[];
|
|
57
|
+
context: LearningContext;
|
|
58
|
+
startTime: Date;
|
|
59
|
+
lastActivity: Date;
|
|
60
|
+
}
|
package/types/index.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { SourceType } from './core';
|
|
2
|
+
|
|
3
|
+
export interface LearningContext {
|
|
4
|
+
id: string;
|
|
5
|
+
sessionId: string;
|
|
6
|
+
userId?: string;
|
|
7
|
+
topic: string;
|
|
8
|
+
previousInteractions: Interaction[];
|
|
9
|
+
learnedPatterns: Pattern[];
|
|
10
|
+
knowledgeGraph: KnowledgeGraph;
|
|
11
|
+
preferences: UserPreferences;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Interaction {
|
|
15
|
+
id: string;
|
|
16
|
+
timestamp: Date;
|
|
17
|
+
query: string;
|
|
18
|
+
response: string;
|
|
19
|
+
feedback?: Feedback;
|
|
20
|
+
contextSnapshot: unknown;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface Feedback {
|
|
24
|
+
rating: number;
|
|
25
|
+
comments?: string;
|
|
26
|
+
helpful: boolean;
|
|
27
|
+
corrections?: string[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Pattern {
|
|
31
|
+
id: string;
|
|
32
|
+
type: 'query_pattern' | 'response_pattern' | 'error_pattern' | 'success_pattern';
|
|
33
|
+
pattern: string;
|
|
34
|
+
frequency: number;
|
|
35
|
+
successRate: number;
|
|
36
|
+
lastObserved: Date;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface KnowledgeGraph {
|
|
40
|
+
nodes: KnowledgeNode[];
|
|
41
|
+
edges: KnowledgeEdge[];
|
|
42
|
+
version: number;
|
|
43
|
+
lastUpdated: Date;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface KnowledgeNode {
|
|
47
|
+
id: string;
|
|
48
|
+
label: string;
|
|
49
|
+
type: 'concept' | 'entity' | 'fact' | 'rule';
|
|
50
|
+
properties: Record<string, unknown>;
|
|
51
|
+
confidence: number;
|
|
52
|
+
sources: string[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export interface KnowledgeEdge {
|
|
56
|
+
from: string;
|
|
57
|
+
to: string;
|
|
58
|
+
relation: string;
|
|
59
|
+
strength: number;
|
|
60
|
+
evidence: string[];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface UserPreferences {
|
|
64
|
+
responseStyle: 'concise' | 'detailed' | 'technical' | 'simple';
|
|
65
|
+
preferredSources: SourceType[];
|
|
66
|
+
topicInterests: string[];
|
|
67
|
+
excludedTopics: string[];
|
|
68
|
+
language: string;
|
|
69
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { TaskStatus, Priority } from './core';
|
|
2
|
+
|
|
3
|
+
export interface Plan {
|
|
4
|
+
id: string;
|
|
5
|
+
goal: string;
|
|
6
|
+
tasks: Task[];
|
|
7
|
+
milestones: Milestone[];
|
|
8
|
+
resources: Resource[];
|
|
9
|
+
timeline: Timeline;
|
|
10
|
+
status: TaskStatus;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface Task {
|
|
16
|
+
id: string;
|
|
17
|
+
title: string;
|
|
18
|
+
description: string;
|
|
19
|
+
priority: Priority;
|
|
20
|
+
status: TaskStatus;
|
|
21
|
+
estimatedDuration: number;
|
|
22
|
+
actualDuration?: number;
|
|
23
|
+
dependencies: string[];
|
|
24
|
+
subtasks: string[];
|
|
25
|
+
assignedTo?: string;
|
|
26
|
+
tags: string[];
|
|
27
|
+
startTime?: Date;
|
|
28
|
+
endTime?: Date;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface Milestone {
|
|
32
|
+
id: string;
|
|
33
|
+
title: string;
|
|
34
|
+
description: string;
|
|
35
|
+
criteria: string[];
|
|
36
|
+
deadline?: Date;
|
|
37
|
+
completedAt?: Date;
|
|
38
|
+
status: TaskStatus;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface Resource {
|
|
42
|
+
id: string;
|
|
43
|
+
type: 'human' | 'tool' | 'data' | 'time' | 'budget';
|
|
44
|
+
name: string;
|
|
45
|
+
availability: number;
|
|
46
|
+
cost?: number;
|
|
47
|
+
skills?: string[];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface Timeline {
|
|
51
|
+
startDate: Date;
|
|
52
|
+
endDate?: Date;
|
|
53
|
+
phases: Phase[];
|
|
54
|
+
criticalPath: string[];
|
|
55
|
+
buffer: number;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface Phase {
|
|
59
|
+
id: string;
|
|
60
|
+
name: string;
|
|
61
|
+
startDate: Date;
|
|
62
|
+
endDate: Date;
|
|
63
|
+
tasks: string[];
|
|
64
|
+
dependencies: string[];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export interface ProgressReport {
|
|
68
|
+
planId: string;
|
|
69
|
+
timestamp: Date;
|
|
70
|
+
overallProgress: number;
|
|
71
|
+
completedTasks: number;
|
|
72
|
+
totalTasks: number;
|
|
73
|
+
onTrack: boolean;
|
|
74
|
+
risks: Risk[];
|
|
75
|
+
nextActions: string[];
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface Risk {
|
|
79
|
+
id: string;
|
|
80
|
+
description: string;
|
|
81
|
+
probability: number;
|
|
82
|
+
impact: number;
|
|
83
|
+
mitigation: string;
|
|
84
|
+
status: 'identified' | 'mitigating' | 'resolved' | 'occurred';
|
|
85
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { TaskStatus } from './core';
|
|
2
|
+
import { Evidence } from './analysis';
|
|
3
|
+
|
|
4
|
+
export enum ReasoningType {
|
|
5
|
+
DEDUCTIVE = 'deductive',
|
|
6
|
+
INDUCTIVE = 'inductive',
|
|
7
|
+
ABDUCTIVE = 'abductive',
|
|
8
|
+
ANALOGICAL = 'analogical',
|
|
9
|
+
CAUSAL = 'causal',
|
|
10
|
+
COUNTERFACTUAL = 'counterfactual'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ReasoningSession {
|
|
14
|
+
id: string;
|
|
15
|
+
problem: string;
|
|
16
|
+
type: ReasoningType;
|
|
17
|
+
steps: ReasoningStep[];
|
|
18
|
+
conclusion?: string;
|
|
19
|
+
confidence: number;
|
|
20
|
+
startTime: Date;
|
|
21
|
+
endTime?: Date;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface ReasoningStep {
|
|
25
|
+
id: string;
|
|
26
|
+
stepNumber: number;
|
|
27
|
+
premise: string;
|
|
28
|
+
inference: string;
|
|
29
|
+
evidence: Evidence[];
|
|
30
|
+
assumptions: string[];
|
|
31
|
+
confidence: number;
|
|
32
|
+
nextSteps: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface Hypothesis {
|
|
36
|
+
id: string;
|
|
37
|
+
statement: string;
|
|
38
|
+
supportingEvidence: Evidence[];
|
|
39
|
+
contradictingEvidence: Evidence[];
|
|
40
|
+
tests: HypothesisTest[];
|
|
41
|
+
status: 'proposed' | 'testing' | 'confirmed' | 'rejected';
|
|
42
|
+
confidence: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface HypothesisTest {
|
|
46
|
+
id: string;
|
|
47
|
+
description: string;
|
|
48
|
+
expectedOutcome: string;
|
|
49
|
+
actualOutcome?: string;
|
|
50
|
+
passed?: boolean;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface ChainOfThought {
|
|
54
|
+
id: string;
|
|
55
|
+
initialQuestion: string;
|
|
56
|
+
thoughts: ThoughtNode[];
|
|
57
|
+
finalAnswer?: string;
|
|
58
|
+
completeness: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface ThoughtNode {
|
|
62
|
+
id: string;
|
|
63
|
+
content: string;
|
|
64
|
+
parentId?: string;
|
|
65
|
+
children: string[];
|
|
66
|
+
depth: number;
|
|
67
|
+
confidence: number;
|
|
68
|
+
type: 'question' | 'observation' | 'inference' | 'conclusion';
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface ProblemDecomposition {
|
|
72
|
+
id: string;
|
|
73
|
+
originalProblem: string;
|
|
74
|
+
subProblems: SubProblem[];
|
|
75
|
+
dependencies: Dependency[];
|
|
76
|
+
solutionStrategy: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface SubProblem {
|
|
80
|
+
id: string;
|
|
81
|
+
description: string;
|
|
82
|
+
difficulty: number;
|
|
83
|
+
estimatedTime: number;
|
|
84
|
+
prerequisites: string[];
|
|
85
|
+
status: TaskStatus;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export interface Dependency {
|
|
89
|
+
from: string;
|
|
90
|
+
to: string;
|
|
91
|
+
type: 'requires' | 'enables' | 'conflicts';
|
|
92
|
+
}
|
package/types/search.ts
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { SourceType } from './core';
|
|
2
|
+
|
|
3
|
+
export interface SearchQuery {
|
|
4
|
+
id: string;
|
|
5
|
+
query: string;
|
|
6
|
+
sources: SourceType[];
|
|
7
|
+
filters: SearchFilters;
|
|
8
|
+
maxResults: number;
|
|
9
|
+
timeout: number;
|
|
10
|
+
timestamp: Date;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface SearchFilters {
|
|
14
|
+
dateRange?: { start: Date; end: Date };
|
|
15
|
+
domains?: string[];
|
|
16
|
+
excludeDomains?: string[];
|
|
17
|
+
language?: string;
|
|
18
|
+
contentType?: ('article' | 'video' | 'image' | 'pdf' | 'forum')[];
|
|
19
|
+
minCredibility?: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface SearchResult {
|
|
23
|
+
id: string;
|
|
24
|
+
title: string;
|
|
25
|
+
url: string;
|
|
26
|
+
snippet: string;
|
|
27
|
+
source: SourceType;
|
|
28
|
+
credibility: number;
|
|
29
|
+
relevance: number;
|
|
30
|
+
timestamp: Date;
|
|
31
|
+
metadata: ResultMetadata;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export interface ResultMetadata {
|
|
35
|
+
author?: string;
|
|
36
|
+
publishDate?: Date;
|
|
37
|
+
wordCount?: number;
|
|
38
|
+
readingTime?: number;
|
|
39
|
+
relatedTopics?: string[];
|
|
40
|
+
citations?: number;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export interface SearchSession {
|
|
44
|
+
id: string;
|
|
45
|
+
queries: SearchQuery[];
|
|
46
|
+
results: SearchResult[];
|
|
47
|
+
aggregatedResults: AggregatedResult[];
|
|
48
|
+
startTime: Date;
|
|
49
|
+
endTime?: Date;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface AggregatedResult {
|
|
53
|
+
topic: string;
|
|
54
|
+
results: SearchResult[];
|
|
55
|
+
consensusScore: number;
|
|
56
|
+
conflictingInfo: boolean;
|
|
57
|
+
keyInsights: string[];
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Priority } from './core';
|
|
2
|
+
|
|
3
|
+
export interface SynthesisResult {
|
|
4
|
+
id: string;
|
|
5
|
+
sources: string[];
|
|
6
|
+
summary: string;
|
|
7
|
+
keyInsights: string[];
|
|
8
|
+
recommendations: Recommendation[];
|
|
9
|
+
confidence: number;
|
|
10
|
+
gaps: string[];
|
|
11
|
+
uncertainties: string[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface Recommendation {
|
|
15
|
+
id: string;
|
|
16
|
+
action: string;
|
|
17
|
+
rationale: string;
|
|
18
|
+
priority: Priority;
|
|
19
|
+
expectedOutcome: string;
|
|
20
|
+
risks: string[];
|
|
21
|
+
confidence: number;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export interface EvaluationResult {
|
|
25
|
+
id: string;
|
|
26
|
+
target: string;
|
|
27
|
+
criteria: EvaluationCriteria[];
|
|
28
|
+
scores: Record<string, number>;
|
|
29
|
+
overallScore: number;
|
|
30
|
+
strengths: string[];
|
|
31
|
+
weaknesses: string[];
|
|
32
|
+
improvements: string[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface EvaluationCriteria {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
weight: number;
|
|
39
|
+
description: string;
|
|
40
|
+
minScore: number;
|
|
41
|
+
maxScore: number;
|
|
42
|
+
}
|