intention-coding 0.0.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/dist/config.d.ts +8 -0
- package/dist/index.cjs +4461 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +4445 -0
- package/dist/schemas/types.d.ts +46 -0
- package/dist/tools/architecture-designer.d.ts +12 -0
- package/dist/tools/export-final-document.d.ts +7 -0
- package/dist/tools/requirement-clarifier.d.ts +15 -0
- package/dist/tools/requirement-manager.d.ts +18 -0
- package/dist/tools/view-requirements-status.d.ts +7 -0
- package/dist/utils/requirements-utils.d.ts +23 -0
- package/dist/utils/storage.d.ts +15 -0
- package/package.json +40 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export interface RequirementEntry {
|
|
3
|
+
timestamp: string;
|
|
4
|
+
category?: string;
|
|
5
|
+
content: string;
|
|
6
|
+
design_focus?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface Requirements {
|
|
9
|
+
project_overview: RequirementEntry[];
|
|
10
|
+
functional_requirements: RequirementEntry[];
|
|
11
|
+
technical_requirements: RequirementEntry[];
|
|
12
|
+
design_requirements: RequirementEntry[];
|
|
13
|
+
deployment_requirements: RequirementEntry[];
|
|
14
|
+
ai_constraints: RequirementEntry[];
|
|
15
|
+
clarification_history: RequirementEntry[];
|
|
16
|
+
architecture_designs: RequirementEntry[];
|
|
17
|
+
last_updated: string | null;
|
|
18
|
+
project_id: string | null;
|
|
19
|
+
}
|
|
20
|
+
export declare const RequirementClarifierParams: z.ZodObject<{
|
|
21
|
+
user_input: z.ZodString;
|
|
22
|
+
context: z.ZodOptional<z.ZodString>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
user_input: string;
|
|
25
|
+
context?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
user_input: string;
|
|
28
|
+
context?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export declare const RequirementManagerParams: z.ZodObject<{
|
|
31
|
+
clarified_info: z.ZodString;
|
|
32
|
+
category: z.ZodEnum<["项目概述", "核心功能需求", "功能和UI需求", "功能需求", "技术需求", "技术和设计约束", "设计需求", "部署需求", "AI约束"]>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
clarified_info: string;
|
|
35
|
+
category: "项目概述" | "核心功能需求" | "功能和UI需求" | "功能需求" | "技术需求" | "技术和设计约束" | "设计需求" | "部署需求" | "AI约束";
|
|
36
|
+
}, {
|
|
37
|
+
clarified_info: string;
|
|
38
|
+
category: "项目概述" | "核心功能需求" | "功能和UI需求" | "功能需求" | "技术需求" | "技术和设计约束" | "设计需求" | "部署需求" | "AI约束";
|
|
39
|
+
}>;
|
|
40
|
+
export declare const ArchitectureDesignerParams: z.ZodObject<{
|
|
41
|
+
design_focus: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
design_focus: string;
|
|
44
|
+
}, {
|
|
45
|
+
design_focus?: string | undefined;
|
|
46
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare const architectureDesignerTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
parameters: import("zod").ZodObject<{
|
|
5
|
+
design_focus: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
|
6
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
7
|
+
design_focus: string;
|
|
8
|
+
}, {
|
|
9
|
+
design_focus?: string | undefined;
|
|
10
|
+
}>;
|
|
11
|
+
execute: (args: any) => Promise<string>;
|
|
12
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const requirementClarifierTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
parameters: import("zod").ZodObject<{
|
|
5
|
+
user_input: import("zod").ZodString;
|
|
6
|
+
context: import("zod").ZodOptional<import("zod").ZodString>;
|
|
7
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
8
|
+
user_input: string;
|
|
9
|
+
context?: string | undefined;
|
|
10
|
+
}, {
|
|
11
|
+
user_input: string;
|
|
12
|
+
context?: string | undefined;
|
|
13
|
+
}>;
|
|
14
|
+
execute: (args: any) => Promise<string>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const requirementManagerTool: {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
parameters: import("zod").ZodObject<{
|
|
5
|
+
clarified_info: import("zod").ZodString;
|
|
6
|
+
category: import("zod").ZodEnum<["项目概述", "核心功能需求", "功能和UI需求", "功能需求", "技术需求", "技术和设计约束", "设计需求", "部署需求", "AI约束"]>;
|
|
7
|
+
}, "strip", import("zod").ZodTypeAny, {
|
|
8
|
+
clarified_info: string;
|
|
9
|
+
category: "项目概述" | "核心功能需求" | "功能和UI需求" | "功能需求" | "技术需求" | "技术和设计约束" | "设计需求" | "部署需求" | "AI约束";
|
|
10
|
+
}, {
|
|
11
|
+
clarified_info: string;
|
|
12
|
+
category: "项目概述" | "核心功能需求" | "功能和UI需求" | "功能需求" | "技术需求" | "技术和设计约束" | "设计需求" | "部署需求" | "AI约束";
|
|
13
|
+
}>;
|
|
14
|
+
execute: (args: {
|
|
15
|
+
clarified_info: any;
|
|
16
|
+
category: any;
|
|
17
|
+
}) => Promise<string>;
|
|
18
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Requirements } from "../schemas/types";
|
|
2
|
+
export declare const currentRequirements: Requirements;
|
|
3
|
+
export declare const categoryMapping: Record<string, keyof Requirements>;
|
|
4
|
+
/**
|
|
5
|
+
* 统计当前需求数量
|
|
6
|
+
*/
|
|
7
|
+
export declare function countRequirements(requirements: Requirements): number;
|
|
8
|
+
/**
|
|
9
|
+
* 获取存储类别
|
|
10
|
+
*/
|
|
11
|
+
export declare function getStorageCategory(category: string): keyof Requirements;
|
|
12
|
+
/**
|
|
13
|
+
* 添加需求条目
|
|
14
|
+
*/
|
|
15
|
+
export declare function addRequirementEntry(requirements: Requirements, category: string, content: string): Requirements;
|
|
16
|
+
/**
|
|
17
|
+
* 格式化需求更新响应信息
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatRequirementUpdateResponse(category: string, content: string, requirements: Requirements, requirementsFile: string, historyFile: string): string;
|
|
20
|
+
/**
|
|
21
|
+
* 格式化需求状态报告
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatRequirementsStatusReport(requirements: Requirements, storageDir: string, requirementsFile: string, historyFile: string): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Requirements } from "../schemas/types";
|
|
2
|
+
export declare class RequirementStorage {
|
|
3
|
+
storageDir: string;
|
|
4
|
+
private _requirementsFile;
|
|
5
|
+
private _historyFile;
|
|
6
|
+
constructor();
|
|
7
|
+
get requirementsFile(): string;
|
|
8
|
+
get historyFile(): string;
|
|
9
|
+
get storageDirectory(): string;
|
|
10
|
+
loadRequirements(): void;
|
|
11
|
+
saveRequirements(currentRequirements: Requirements): void;
|
|
12
|
+
saveHistoryEntry(entryType: string, content: string, metadata?: Record<string, any>): void;
|
|
13
|
+
exportFinalDocument(currentRequirements: Requirements): string | null;
|
|
14
|
+
private generateMarkdownReport;
|
|
15
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "intention-coding",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"import": "./dist/index.js",
|
|
9
|
+
"require": "./dist/index.cjs"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"bin": "dist/index.cjs",
|
|
13
|
+
"main": "./dist/index.cjs",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "rslib build",
|
|
21
|
+
"dev": "rslib build --watch",
|
|
22
|
+
"test": "vitest run",
|
|
23
|
+
"test-mcp": "npx fastmcp dev src/index.ts",
|
|
24
|
+
"inspect": "npx fastmcp inspect ./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@modelcontextprotocol/inspector": "0.9.0",
|
|
28
|
+
"@modelcontextprotocol/sdk": "1.10.2",
|
|
29
|
+
"@rslib/core": "^0.10.0",
|
|
30
|
+
"@types/node": "^18.0.0",
|
|
31
|
+
"dotenv": "16.4.5",
|
|
32
|
+
"typescript": "^5.8.3",
|
|
33
|
+
"vitest": "3.2.3",
|
|
34
|
+
"zod": "3.25.64"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"fastmcp": "^3.3.0"
|
|
38
|
+
},
|
|
39
|
+
"license": "MIT"
|
|
40
|
+
}
|