@shin1ohno/sage 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 +168 -0
- package/dist/config/loader.d.ts +37 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +95 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/storage/file-storage.d.ts +35 -0
- package/dist/config/storage/file-storage.d.ts.map +1 -0
- package/dist/config/storage/file-storage.js +76 -0
- package/dist/config/storage/file-storage.js.map +1 -0
- package/dist/config/storage/index.d.ts +8 -0
- package/dist/config/storage/index.d.ts.map +1 -0
- package/dist/config/storage/index.js +8 -0
- package/dist/config/storage/index.js.map +1 -0
- package/dist/config/storage/session-storage.d.ts +35 -0
- package/dist/config/storage/session-storage.d.ts.map +1 -0
- package/dist/config/storage/session-storage.js +44 -0
- package/dist/config/storage/session-storage.js.map +1 -0
- package/dist/config/storage/storage-factory.d.ts +32 -0
- package/dist/config/storage/storage-factory.d.ts.map +1 -0
- package/dist/config/storage/storage-factory.js +78 -0
- package/dist/config/storage/storage-factory.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/sage-core.d.ts +80 -0
- package/dist/core/sage-core.d.ts.map +1 -0
- package/dist/core/sage-core.js +190 -0
- package/dist/core/sage-core.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +901 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/apple-reminders.d.ts +96 -0
- package/dist/integrations/apple-reminders.d.ts.map +1 -0
- package/dist/integrations/apple-reminders.js +250 -0
- package/dist/integrations/apple-reminders.js.map +1 -0
- package/dist/integrations/calendar-service.d.ts +126 -0
- package/dist/integrations/calendar-service.d.ts.map +1 -0
- package/dist/integrations/calendar-service.js +295 -0
- package/dist/integrations/calendar-service.js.map +1 -0
- package/dist/integrations/notion-mcp.d.ts +121 -0
- package/dist/integrations/notion-mcp.d.ts.map +1 -0
- package/dist/integrations/notion-mcp.js +281 -0
- package/dist/integrations/notion-mcp.js.map +1 -0
- package/dist/integrations/reminder-manager.d.ts +90 -0
- package/dist/integrations/reminder-manager.d.ts.map +1 -0
- package/dist/integrations/reminder-manager.js +182 -0
- package/dist/integrations/reminder-manager.js.map +1 -0
- package/dist/platform/adapter-factory.d.ts +22 -0
- package/dist/platform/adapter-factory.d.ts.map +1 -0
- package/dist/platform/adapter-factory.js +41 -0
- package/dist/platform/adapter-factory.js.map +1 -0
- package/dist/platform/adapters/mcp-adapter.d.ts +32 -0
- package/dist/platform/adapters/mcp-adapter.d.ts.map +1 -0
- package/dist/platform/adapters/mcp-adapter.js +52 -0
- package/dist/platform/adapters/mcp-adapter.js.map +1 -0
- package/dist/platform/adapters/skills-adapter-ios.d.ts +38 -0
- package/dist/platform/adapters/skills-adapter-ios.d.ts.map +1 -0
- package/dist/platform/adapters/skills-adapter-ios.js +59 -0
- package/dist/platform/adapters/skills-adapter-ios.js.map +1 -0
- package/dist/platform/adapters/skills-adapter-web.d.ts +36 -0
- package/dist/platform/adapters/skills-adapter-web.d.ts.map +1 -0
- package/dist/platform/adapters/skills-adapter-web.js +56 -0
- package/dist/platform/adapters/skills-adapter-web.js.map +1 -0
- package/dist/platform/detector.d.ts +60 -0
- package/dist/platform/detector.d.ts.map +1 -0
- package/dist/platform/detector.js +217 -0
- package/dist/platform/detector.js.map +1 -0
- package/dist/platform/index.d.ts +11 -0
- package/dist/platform/index.d.ts.map +1 -0
- package/dist/platform/index.js +11 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/types.d.ts +205 -0
- package/dist/platform/types.d.ts.map +1 -0
- package/dist/platform/types.js +33 -0
- package/dist/platform/types.js.map +1 -0
- package/dist/setup/questions.d.ts +15 -0
- package/dist/setup/questions.d.ts.map +1 -0
- package/dist/setup/questions.js +131 -0
- package/dist/setup/questions.js.map +1 -0
- package/dist/setup/wizard.d.ts +51 -0
- package/dist/setup/wizard.d.ts.map +1 -0
- package/dist/setup/wizard.js +210 -0
- package/dist/setup/wizard.js.map +1 -0
- package/dist/tools/analyze-tasks.d.ts +61 -0
- package/dist/tools/analyze-tasks.d.ts.map +1 -0
- package/dist/tools/analyze-tasks.js +258 -0
- package/dist/tools/analyze-tasks.js.map +1 -0
- package/dist/types/config.d.ts +126 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +118 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/errors.d.ts +39 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +83 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/index.d.ts +7 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +7 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/task.d.ts +69 -0
- package/dist/types/task.d.ts.map +1 -0
- package/dist/types/task.js +5 -0
- package/dist/types/task.js.map +1 -0
- package/dist/utils/estimation.d.ts +49 -0
- package/dist/utils/estimation.d.ts.map +1 -0
- package/dist/utils/estimation.js +244 -0
- package/dist/utils/estimation.js.map +1 -0
- package/dist/utils/priority.d.ts +68 -0
- package/dist/utils/priority.d.ts.map +1 -0
- package/dist/utils/priority.js +243 -0
- package/dist/utils/priority.js.map +1 -0
- package/dist/utils/retry.d.ts +62 -0
- package/dist/utils/retry.d.ts.map +1 -0
- package/dist/utils/retry.js +161 -0
- package/dist/utils/retry.js.map +1 -0
- package/dist/utils/stakeholders.d.ts +61 -0
- package/dist/utils/stakeholders.d.ts.map +1 -0
- package/dist/utils/stakeholders.js +301 -0
- package/dist/utils/stakeholders.js.map +1 -0
- package/dist/utils/task-splitter.d.ts +45 -0
- package/dist/utils/task-splitter.d.ts.map +1 -0
- package/dist/utils/task-splitter.js +321 -0
- package/dist/utils/task-splitter.js.map +1 -0
- package/package.json +66 -0
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error type definitions
|
|
3
|
+
*/
|
|
4
|
+
export var ErrorType;
|
|
5
|
+
(function (ErrorType) {
|
|
6
|
+
ErrorType["SETUP_ERROR"] = "SETUP_ERROR";
|
|
7
|
+
ErrorType["CONFIG_ERROR"] = "CONFIG_ERROR";
|
|
8
|
+
ErrorType["VALIDATION_ERROR"] = "VALIDATION_ERROR";
|
|
9
|
+
ErrorType["INTEGRATION_ERROR"] = "INTEGRATION_ERROR";
|
|
10
|
+
ErrorType["ANALYSIS_ERROR"] = "ANALYSIS_ERROR";
|
|
11
|
+
ErrorType["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
12
|
+
ErrorType["AUTH_ERROR"] = "AUTH_ERROR";
|
|
13
|
+
})(ErrorType || (ErrorType = {}));
|
|
14
|
+
export class SageErrorImpl extends Error {
|
|
15
|
+
type;
|
|
16
|
+
code;
|
|
17
|
+
recoverable;
|
|
18
|
+
details;
|
|
19
|
+
suggestions;
|
|
20
|
+
constructor(type, code, message, options) {
|
|
21
|
+
super(message);
|
|
22
|
+
this.name = 'SageError';
|
|
23
|
+
this.type = type;
|
|
24
|
+
this.code = code;
|
|
25
|
+
this.recoverable = options?.recoverable ?? true;
|
|
26
|
+
this.details = options?.details;
|
|
27
|
+
this.suggestions = options?.suggestions;
|
|
28
|
+
}
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
type: this.type,
|
|
32
|
+
code: this.code,
|
|
33
|
+
message: this.message,
|
|
34
|
+
details: this.details,
|
|
35
|
+
recoverable: this.recoverable,
|
|
36
|
+
suggestions: this.suggestions,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export class ErrorHandler {
|
|
41
|
+
static handle(error, context) {
|
|
42
|
+
if (error instanceof SageErrorImpl) {
|
|
43
|
+
return error.toJSON();
|
|
44
|
+
}
|
|
45
|
+
// Classify unknown errors
|
|
46
|
+
const errorMessage = error.message.toLowerCase();
|
|
47
|
+
if (errorMessage.includes('network') || errorMessage.includes('fetch')) {
|
|
48
|
+
return {
|
|
49
|
+
type: ErrorType.NETWORK_ERROR,
|
|
50
|
+
code: 'NETWORK_FAILURE',
|
|
51
|
+
message: `ネットワークエラーが発生しました: ${context}`,
|
|
52
|
+
details: error.message,
|
|
53
|
+
recoverable: true,
|
|
54
|
+
suggestions: ['インターネット接続を確認してください', 'しばらく待ってから再試行してください'],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
if (errorMessage.includes('auth') || errorMessage.includes('unauthorized')) {
|
|
58
|
+
return {
|
|
59
|
+
type: ErrorType.AUTH_ERROR,
|
|
60
|
+
code: 'AUTH_FAILURE',
|
|
61
|
+
message: `認証エラーが発生しました: ${context}`,
|
|
62
|
+
details: error.message,
|
|
63
|
+
recoverable: true,
|
|
64
|
+
suggestions: ['APIキーが正しく設定されているか確認してください', '認証情報を再設定してください'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
type: ErrorType.INTEGRATION_ERROR,
|
|
69
|
+
code: 'UNKNOWN_ERROR',
|
|
70
|
+
message: `予期しないエラーが発生しました: ${context}`,
|
|
71
|
+
details: error.message,
|
|
72
|
+
recoverable: false,
|
|
73
|
+
suggestions: ['エラーが続く場合は設定を確認してください'],
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
static shouldRetry(error) {
|
|
77
|
+
return error.recoverable && error.type === ErrorType.NETWORK_ERROR;
|
|
78
|
+
}
|
|
79
|
+
static getSuggestions(error) {
|
|
80
|
+
return error.suggestions ?? [];
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/types/errors.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,CAAN,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,wCAA2B,CAAA;IAC3B,0C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ources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task-related type definitions
|
|
3
|
+
*/
|
|
4
|
+
export type TaskStatus = 'not_started' | 'in_progress' | 'blocked' | 'completed';
|
|
5
|
+
export type Priority = 'P0' | 'P1' | 'P2' | 'P3';
|
|
6
|
+
export interface Task {
|
|
7
|
+
title: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
deadline?: string;
|
|
10
|
+
dependencies?: string[];
|
|
11
|
+
status?: TaskStatus;
|
|
12
|
+
tags?: string[];
|
|
13
|
+
metadata?: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export interface SubTask extends Task {
|
|
16
|
+
parentTaskId?: string;
|
|
17
|
+
order: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TaskDependency {
|
|
20
|
+
taskIndex: number;
|
|
21
|
+
dependsOn: number[];
|
|
22
|
+
type: 'sequential' | 'parallel' | 'conditional';
|
|
23
|
+
}
|
|
24
|
+
export interface SplitResult {
|
|
25
|
+
originalInput: string;
|
|
26
|
+
splitTasks: Task[];
|
|
27
|
+
splitReason: string;
|
|
28
|
+
recommendedOrder: number[];
|
|
29
|
+
dependencies: TaskDependency[];
|
|
30
|
+
}
|
|
31
|
+
export interface ComplexityAnalysis {
|
|
32
|
+
isComplex: boolean;
|
|
33
|
+
complexity: 'simple' | 'medium' | 'complex' | 'project';
|
|
34
|
+
suggestedSplits?: SubTask[];
|
|
35
|
+
reasoning: string;
|
|
36
|
+
}
|
|
37
|
+
export interface AnalyzedTask {
|
|
38
|
+
original: Task;
|
|
39
|
+
priority: Priority;
|
|
40
|
+
estimatedMinutes: number;
|
|
41
|
+
stakeholders: string[];
|
|
42
|
+
suggestedReminders: Reminder[];
|
|
43
|
+
suggestedTimeSlot?: TimeSlot;
|
|
44
|
+
reasoning: AnalysisReasoning;
|
|
45
|
+
tags: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface AnalysisReasoning {
|
|
48
|
+
priorityReason: string;
|
|
49
|
+
estimationReason: string;
|
|
50
|
+
stakeholderReason: string;
|
|
51
|
+
schedulingReason?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface Reminder {
|
|
54
|
+
type: string;
|
|
55
|
+
time: string;
|
|
56
|
+
message?: string;
|
|
57
|
+
}
|
|
58
|
+
export interface TimeSlot {
|
|
59
|
+
start: string;
|
|
60
|
+
end: string;
|
|
61
|
+
durationMinutes: number;
|
|
62
|
+
}
|
|
63
|
+
export interface AvailableSlot extends TimeSlot {
|
|
64
|
+
suitability: 'excellent' | 'good' | 'acceptable';
|
|
65
|
+
reason: string;
|
|
66
|
+
conflicts: string[];
|
|
67
|
+
dayType: 'deep-work' | 'meeting-heavy' | 'normal';
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=task.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../../src/types/task.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,CAAC;AAEjF,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,MAAM,WAAW,IAAI;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,EAA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BAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,aAAc,SAAQ,QAAQ;IAC7C,WAAW,EAAE,WAAW,GAAG,MAAM,GAAG,YAAY,CAAC;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,WAAW,GAAG,eAAe,GAAG,QAAQ,CAAC;CACnD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../../src/types/task.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Estimation System
|
|
3
|
+
* Estimates task duration based on keywords and complexity
|
|
4
|
+
* Requirements: 2.6, 3.1, 3.2
|
|
5
|
+
*/
|
|
6
|
+
import type { Task, EstimationConfig } from '../types/index.js';
|
|
7
|
+
interface EstimationResult {
|
|
8
|
+
estimatedMinutes: number;
|
|
9
|
+
complexity: 'simple' | 'medium' | 'complex' | 'project';
|
|
10
|
+
reason: string;
|
|
11
|
+
matchedKeywords: string[];
|
|
12
|
+
}
|
|
13
|
+
export declare const DEFAULT_ESTIMATION_CONFIG: EstimationConfig;
|
|
14
|
+
export declare class TimeEstimator {
|
|
15
|
+
/**
|
|
16
|
+
* Estimate task duration
|
|
17
|
+
* Requirement: 2.6, 3.1, 3.2
|
|
18
|
+
*/
|
|
19
|
+
static estimateDuration(task: Task, config?: EstimationConfig): EstimationResult;
|
|
20
|
+
/**
|
|
21
|
+
* Find matching keywords in text
|
|
22
|
+
*/
|
|
23
|
+
private static findMatchingKeywords;
|
|
24
|
+
/**
|
|
25
|
+
* Apply modifiers based on task characteristics
|
|
26
|
+
*/
|
|
27
|
+
private static applyModifiers;
|
|
28
|
+
/**
|
|
29
|
+
* Get length modifier based on task description length
|
|
30
|
+
*/
|
|
31
|
+
private static getLengthModifier;
|
|
32
|
+
/**
|
|
33
|
+
* Build a human-readable reason
|
|
34
|
+
* Note: This is only called when keywords are found
|
|
35
|
+
*/
|
|
36
|
+
private static buildReason;
|
|
37
|
+
/**
|
|
38
|
+
* Analyze keywords in text and return complexity indicators
|
|
39
|
+
*/
|
|
40
|
+
static analyzeKeywords(text: string, config?: EstimationConfig): {
|
|
41
|
+
simple: string[];
|
|
42
|
+
medium: string[];
|
|
43
|
+
complex: string[];
|
|
44
|
+
project: string[];
|
|
45
|
+
matched: string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
49
|
+
//# sourceMappingURL=estimation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimation.d.ts","sourceRoot":"","sources":["../../src/utils/estimation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEhE,UAAU,gBAAgB;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAGD,eAAO,MAAM,yBAAyB,EAAE,gBAkFvC,CAAC;AAkBF,qBAAa,aAAa;IACxB;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,GAAE,gBAA4C,GAAG,gBAAgB;IA4E3G;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,oBAAoB;IAInC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAmB7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAShC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAiB1B;;OAEG;IACH,MAAM,CAAC,eAAe,CACpB,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,gBAA4C,GACnD;QACD,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAAC;QAClB,OAAO,EAAE,MAAM,EAAE,CAAC;KACnB;CAgBF"}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Time Estimation System
|
|
3
|
+
* Estimates task duration based on keywords and complexity
|
|
4
|
+
* Requirements: 2.6, 3.1, 3.2
|
|
5
|
+
*/
|
|
6
|
+
// Default estimation config
|
|
7
|
+
export const DEFAULT_ESTIMATION_CONFIG = {
|
|
8
|
+
simpleTaskMinutes: 25,
|
|
9
|
+
mediumTaskMinutes: 50,
|
|
10
|
+
complexTaskMinutes: 90,
|
|
11
|
+
projectTaskMinutes: 180,
|
|
12
|
+
keywordMapping: {
|
|
13
|
+
simple: [
|
|
14
|
+
'check',
|
|
15
|
+
'review',
|
|
16
|
+
'read',
|
|
17
|
+
'confirm',
|
|
18
|
+
'send',
|
|
19
|
+
'reply',
|
|
20
|
+
'answer',
|
|
21
|
+
'確認',
|
|
22
|
+
'レビュー',
|
|
23
|
+
'読む',
|
|
24
|
+
'返信',
|
|
25
|
+
'送信',
|
|
26
|
+
'回答',
|
|
27
|
+
'approve',
|
|
28
|
+
'承認',
|
|
29
|
+
'quick',
|
|
30
|
+
'すぐ',
|
|
31
|
+
'simple',
|
|
32
|
+
'シンプル',
|
|
33
|
+
],
|
|
34
|
+
medium: [
|
|
35
|
+
'implement',
|
|
36
|
+
'fix',
|
|
37
|
+
'update',
|
|
38
|
+
'create',
|
|
39
|
+
'modify',
|
|
40
|
+
'add',
|
|
41
|
+
'write',
|
|
42
|
+
'実装',
|
|
43
|
+
'修正',
|
|
44
|
+
'更新',
|
|
45
|
+
'作成',
|
|
46
|
+
'変更',
|
|
47
|
+
'追加',
|
|
48
|
+
'書く',
|
|
49
|
+
'develop',
|
|
50
|
+
'開発',
|
|
51
|
+
'test',
|
|
52
|
+
'テスト',
|
|
53
|
+
],
|
|
54
|
+
complex: [
|
|
55
|
+
'design',
|
|
56
|
+
'refactor',
|
|
57
|
+
'migrate',
|
|
58
|
+
'integrate',
|
|
59
|
+
'optimize',
|
|
60
|
+
'analyze',
|
|
61
|
+
'設計',
|
|
62
|
+
'リファクタ',
|
|
63
|
+
'移行',
|
|
64
|
+
'統合',
|
|
65
|
+
'最適化',
|
|
66
|
+
'分析',
|
|
67
|
+
'research',
|
|
68
|
+
'調査',
|
|
69
|
+
'investigate',
|
|
70
|
+
'調べる',
|
|
71
|
+
],
|
|
72
|
+
project: [
|
|
73
|
+
'build',
|
|
74
|
+
'architect',
|
|
75
|
+
'system',
|
|
76
|
+
'platform',
|
|
77
|
+
'infrastructure',
|
|
78
|
+
'構築',
|
|
79
|
+
'アーキテクチャ',
|
|
80
|
+
'システム',
|
|
81
|
+
'プラットフォーム',
|
|
82
|
+
'インフラ',
|
|
83
|
+
'framework',
|
|
84
|
+
'フレームワーク',
|
|
85
|
+
'rewrite',
|
|
86
|
+
'書き直し',
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
// Task length modifiers
|
|
91
|
+
const LENGTH_MODIFIERS = {
|
|
92
|
+
short: 0.75, // Very short description
|
|
93
|
+
normal: 1.0, // Normal description
|
|
94
|
+
long: 1.25, // Long description with details
|
|
95
|
+
veryLong: 1.5, // Very detailed with multiple components
|
|
96
|
+
};
|
|
97
|
+
// Special modifiers
|
|
98
|
+
const SPECIAL_MODIFIERS = {
|
|
99
|
+
meeting: { keywords: ['meeting', 'ミーティング', '会議', 'sync', 'call', '通話'], multiplier: 1.5 },
|
|
100
|
+
documentation: { keywords: ['document', 'ドキュメント', '文書', 'doc', 'docs'], multiplier: 1.25 },
|
|
101
|
+
debugging: { keywords: ['debug', 'デバッグ', 'bug', 'バグ', 'issue', '問題'], multiplier: 1.5 },
|
|
102
|
+
testing: { keywords: ['test', 'テスト', 'qa', 'verify', '検証'], multiplier: 1.25 },
|
|
103
|
+
};
|
|
104
|
+
export class TimeEstimator {
|
|
105
|
+
/**
|
|
106
|
+
* Estimate task duration
|
|
107
|
+
* Requirement: 2.6, 3.1, 3.2
|
|
108
|
+
*/
|
|
109
|
+
static estimateDuration(task, config = DEFAULT_ESTIMATION_CONFIG) {
|
|
110
|
+
const text = `${task.title} ${task.description ?? ''}`.toLowerCase();
|
|
111
|
+
const matchedKeywords = [];
|
|
112
|
+
// Check for project-level keywords
|
|
113
|
+
const projectMatches = this.findMatchingKeywords(text, config.keywordMapping.project);
|
|
114
|
+
if (projectMatches.length > 0) {
|
|
115
|
+
matchedKeywords.push(...projectMatches);
|
|
116
|
+
const baseMinutes = config.projectTaskMinutes;
|
|
117
|
+
const modifiedMinutes = this.applyModifiers(baseMinutes, text, task);
|
|
118
|
+
return {
|
|
119
|
+
estimatedMinutes: Math.round(modifiedMinutes),
|
|
120
|
+
complexity: 'project',
|
|
121
|
+
reason: this.buildReason('project', projectMatches, modifiedMinutes),
|
|
122
|
+
matchedKeywords,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// Check for complex keywords
|
|
126
|
+
const complexMatches = this.findMatchingKeywords(text, config.keywordMapping.complex);
|
|
127
|
+
if (complexMatches.length > 0) {
|
|
128
|
+
matchedKeywords.push(...complexMatches);
|
|
129
|
+
const baseMinutes = config.complexTaskMinutes;
|
|
130
|
+
const modifiedMinutes = this.applyModifiers(baseMinutes, text, task);
|
|
131
|
+
return {
|
|
132
|
+
estimatedMinutes: Math.round(modifiedMinutes),
|
|
133
|
+
complexity: 'complex',
|
|
134
|
+
reason: this.buildReason('complex', complexMatches, modifiedMinutes),
|
|
135
|
+
matchedKeywords,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
// Check for medium keywords
|
|
139
|
+
const mediumMatches = this.findMatchingKeywords(text, config.keywordMapping.medium);
|
|
140
|
+
if (mediumMatches.length > 0) {
|
|
141
|
+
matchedKeywords.push(...mediumMatches);
|
|
142
|
+
const baseMinutes = config.mediumTaskMinutes;
|
|
143
|
+
const modifiedMinutes = this.applyModifiers(baseMinutes, text, task);
|
|
144
|
+
return {
|
|
145
|
+
estimatedMinutes: Math.round(modifiedMinutes),
|
|
146
|
+
complexity: 'medium',
|
|
147
|
+
reason: this.buildReason('medium', mediumMatches, modifiedMinutes),
|
|
148
|
+
matchedKeywords,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
// Check for simple keywords
|
|
152
|
+
const simpleMatches = this.findMatchingKeywords(text, config.keywordMapping.simple);
|
|
153
|
+
if (simpleMatches.length > 0) {
|
|
154
|
+
matchedKeywords.push(...simpleMatches);
|
|
155
|
+
const baseMinutes = config.simpleTaskMinutes;
|
|
156
|
+
const modifiedMinutes = this.applyModifiers(baseMinutes, text, task);
|
|
157
|
+
return {
|
|
158
|
+
estimatedMinutes: Math.round(modifiedMinutes),
|
|
159
|
+
complexity: 'simple',
|
|
160
|
+
reason: this.buildReason('simple', simpleMatches, modifiedMinutes),
|
|
161
|
+
matchedKeywords,
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
// Default to medium complexity
|
|
165
|
+
const baseMinutes = config.mediumTaskMinutes;
|
|
166
|
+
const modifiedMinutes = this.applyModifiers(baseMinutes, text, task);
|
|
167
|
+
return {
|
|
168
|
+
estimatedMinutes: Math.round(modifiedMinutes),
|
|
169
|
+
complexity: 'medium',
|
|
170
|
+
reason: `キーワードが検出されなかったため、標準的なタスク(${modifiedMinutes}分)として見積もり`,
|
|
171
|
+
matchedKeywords: [],
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Find matching keywords in text
|
|
176
|
+
*/
|
|
177
|
+
static findMatchingKeywords(text, keywords) {
|
|
178
|
+
return keywords.filter((keyword) => text.includes(keyword.toLowerCase()));
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Apply modifiers based on task characteristics
|
|
182
|
+
*/
|
|
183
|
+
static applyModifiers(baseMinutes, text, task) {
|
|
184
|
+
let minutes = baseMinutes;
|
|
185
|
+
// Apply length modifier
|
|
186
|
+
const lengthModifier = this.getLengthModifier(task);
|
|
187
|
+
minutes *= lengthModifier;
|
|
188
|
+
// Apply special modifiers
|
|
189
|
+
for (const [_name, { keywords, multiplier }] of Object.entries(SPECIAL_MODIFIERS)) {
|
|
190
|
+
if (keywords.some((k) => text.includes(k.toLowerCase()))) {
|
|
191
|
+
minutes *= multiplier;
|
|
192
|
+
break; // Only apply one special modifier
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Round to nearest 5 minutes
|
|
196
|
+
return Math.round(minutes / 5) * 5;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get length modifier based on task description length
|
|
200
|
+
*/
|
|
201
|
+
static getLengthModifier(task) {
|
|
202
|
+
const totalLength = (task.title?.length ?? 0) + (task.description?.length ?? 0);
|
|
203
|
+
if (totalLength < 30)
|
|
204
|
+
return LENGTH_MODIFIERS.short;
|
|
205
|
+
if (totalLength < 100)
|
|
206
|
+
return LENGTH_MODIFIERS.normal;
|
|
207
|
+
if (totalLength < 250)
|
|
208
|
+
return LENGTH_MODIFIERS.long;
|
|
209
|
+
return LENGTH_MODIFIERS.veryLong;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Build a human-readable reason
|
|
213
|
+
* Note: This is only called when keywords are found
|
|
214
|
+
*/
|
|
215
|
+
static buildReason(complexity, matchedKeywords, minutes) {
|
|
216
|
+
const complexityNames = {
|
|
217
|
+
simple: 'シンプル',
|
|
218
|
+
medium: '標準',
|
|
219
|
+
complex: '複雑',
|
|
220
|
+
project: 'プロジェクト',
|
|
221
|
+
};
|
|
222
|
+
const complexityName = complexityNames[complexity];
|
|
223
|
+
const keywordStr = matchedKeywords.slice(0, 3).join('、');
|
|
224
|
+
return `「${keywordStr}」を含む${complexityName}なタスクとして${minutes}分と見積もり`;
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Analyze keywords in text and return complexity indicators
|
|
228
|
+
*/
|
|
229
|
+
static analyzeKeywords(text, config = DEFAULT_ESTIMATION_CONFIG) {
|
|
230
|
+
const lowerText = text.toLowerCase();
|
|
231
|
+
const simple = this.findMatchingKeywords(lowerText, config.keywordMapping.simple);
|
|
232
|
+
const medium = this.findMatchingKeywords(lowerText, config.keywordMapping.medium);
|
|
233
|
+
const complex = this.findMatchingKeywords(lowerText, config.keywordMapping.complex);
|
|
234
|
+
const project = this.findMatchingKeywords(lowerText, config.keywordMapping.project);
|
|
235
|
+
return {
|
|
236
|
+
simple,
|
|
237
|
+
medium,
|
|
238
|
+
complex,
|
|
239
|
+
project,
|
|
240
|
+
matched: [...simple, ...medium, ...complex, ...project],
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
//# sourceMappingURL=estimation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"estimation.js","sourceRoot":"","sources":["../../src/utils/estimation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,yBAAyB,GAAqB;IACzD,iBAAiB,EAAE,EAAE;IACrB,iBAAiB,EAAE,EAAE;IACrB,kBAAkB,EAAE,EAAE;IACtB,kBAAkB,EAAE,GAAG;IACvB,cAAc,EAAE;QACd,MAAM,EAAE;YACN,OAAO;YACP,QAAQ;YACR,MAAM;YACN,SAAS;YACT,MAAM;YACN,OAAO;YACP,QAAQ;YACR,IAAI;YAC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,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACzD,OAAO,IAAI,UAAU,OAAO,cAAc,UAAU,OAAO,QAAQ,CAAC;IACtE,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe,CACpB,IAAY,EACZ,SAA2B,yBAAyB;QAQpD,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QAErC,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAClF,MAAM,MAAM,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAClF,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACpF,MAAM,OAAO,GAAG,IAAI,CAAC,oBAAoB,CAAC,SAAS,EAAE,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QAEpF,OAAO;YACL,MAAM;YACN,MAAM;YACN,OAAO;YACP,OAAO;YACP,OAAO,EAAE,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,OAAO,EAAE,GAAG,OAAO,CAAC;SACxD,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Priority Engine
|
|
3
|
+
* Determines task priority based on rules and conditions
|
|
4
|
+
* Requirements: 2.1-2.5
|
|
5
|
+
*/
|
|
6
|
+
import type { Task, Priority, PriorityRules, PriorityCondition, TeamConfig } from '../types/index.js';
|
|
7
|
+
interface PriorityResult {
|
|
8
|
+
priority: Priority;
|
|
9
|
+
reason: string;
|
|
10
|
+
conditions: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare class PriorityEngine {
|
|
13
|
+
/**
|
|
14
|
+
* Determine the priority of a task
|
|
15
|
+
* Requirement: 2.1, 2.2, 2.5
|
|
16
|
+
*/
|
|
17
|
+
static determinePriority(task: Task, rules: PriorityRules, teamConfig?: TeamConfig): PriorityResult;
|
|
18
|
+
/**
|
|
19
|
+
* Evaluate a set of conditions against a task
|
|
20
|
+
* Requirement: 2.2, 2.3, 2.4
|
|
21
|
+
*/
|
|
22
|
+
static evaluateConditions(task: Task, conditions: PriorityCondition[], teamConfig?: TeamConfig): {
|
|
23
|
+
matched: boolean;
|
|
24
|
+
reasons: string[];
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Evaluate a single condition
|
|
28
|
+
*/
|
|
29
|
+
private static evaluateSingleCondition;
|
|
30
|
+
/**
|
|
31
|
+
* Evaluate deadline-based conditions
|
|
32
|
+
* Requirement: 2.3
|
|
33
|
+
*/
|
|
34
|
+
private static evaluateDeadlineCondition;
|
|
35
|
+
/**
|
|
36
|
+
* Evaluate keyword-based conditions
|
|
37
|
+
* Requirement: 2.3
|
|
38
|
+
*/
|
|
39
|
+
private static evaluateKeywordCondition;
|
|
40
|
+
/**
|
|
41
|
+
* Evaluate stakeholder-based conditions
|
|
42
|
+
* Requirement: 2.4
|
|
43
|
+
*/
|
|
44
|
+
private static evaluateStakeholderCondition;
|
|
45
|
+
/**
|
|
46
|
+
* Evaluate blocking task conditions
|
|
47
|
+
*/
|
|
48
|
+
private static evaluateBlockingCondition;
|
|
49
|
+
/**
|
|
50
|
+
* Evaluate custom conditions
|
|
51
|
+
*/
|
|
52
|
+
private static evaluateCustomCondition;
|
|
53
|
+
/**
|
|
54
|
+
* Quick check for urgent keywords without full rules
|
|
55
|
+
*/
|
|
56
|
+
static hasUrgentKeywords(text: string): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Quick check for important keywords without full rules
|
|
59
|
+
*/
|
|
60
|
+
static hasImportantKeywords(text: string): boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Build a human-readable reason string
|
|
63
|
+
* Note: This is only called when conditions are matched
|
|
64
|
+
*/
|
|
65
|
+
private static buildReason;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=priority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"priority.d.ts","sourceRoot":"","sources":["../../src/utils/priority.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAgCtG,UAAU,cAAc;IACtB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qBAAa,cAAc;IACzB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CACtB,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,aAAa,EACpB,UAAU,CAAC,EAAE,UAAU,GACtB,cAAc;IAuCjB;;;OAGG;IACH,MAAM,CAAC,kBAAkB,CACvB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,iBAAiB,EAAE,EAC/B,UAAU,CAAC,EAAE,UAAU,GACtB;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,EAAE,CAAA;KAAE;IAe1C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IA4BtC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAoCxC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAgBvC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IA6B3C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;IAcxC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,uBAAuB;IActC;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAK/C;;OAEG;IACH,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